Skip to content

Commit 6eba1a9

Browse files
author
Eric Castro
committed
Fix Content-type value on POST (and other methods != GET)
Fixes sending the wrong Content-Type header by removing the application/json value it was wrongly setting by default. Only application/x-www-form-urlencoded is now sent, so the server can interpret the HTTP body accordingly.
1 parent 04926b9 commit 6eba1a9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

VisualJSON/VJDocument.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ - (void)refreshBackground {
377377

378378
if (self.method && ![self.method isEqualToString:@"GET"]) {
379379
[req setHTTPMethod:self.method];
380+
[req setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-type"];
380381
[req setHTTPBody:self.querydata.dataUsingUTF8Encoding];
381382
}
382383

0 commit comments

Comments
 (0)