From fec0d9c41d16a4e70639e5677d6f5d95b5f9aac0 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Sat, 31 Jan 2015 22:15:15 +0800 Subject: [PATCH] Set default value for `Content-Type` of headfield in `PUT` method --- cocos/network/HttpClient-ios.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cocos/network/HttpClient-ios.mm b/cocos/network/HttpClient-ios.mm index 3561367d29..9a63e5e265 100644 --- a/cocos/network/HttpClient-ios.mm +++ b/cocos/network/HttpClient-ios.mm @@ -170,6 +170,10 @@ static int processTask(HttpRequest *request, NSString* requestType, void *stream //if request type is post or put,set header and data if([requestType isEqual: @"POST"] || [requestType isEqual: @"PUT"]) { + if ([requestType isEqual: @"PUT"]) + { + [nsrequest setValue: @"application/x-www-form-urlencoded" forHTTPHeaderField: @"Content-Type"]; + } /* get custom header data (if set) */ std::vector headers=request->getHeaders(); if(!headers.empty())