mirror of https://github.com/axmolengine/axmol.git
Fix the error that the binary data would be truncated
This commit is contained in:
parent
a1c8c615ac
commit
e6d50d7086
|
@ -164,6 +164,7 @@ static int processTask(HttpRequest *request, NSString* requestType, void *stream
|
|||
cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData
|
||||
timeoutInterval:HttpClient::getInstance()->getTimeoutForConnect()];
|
||||
|
||||
|
||||
//set request type
|
||||
[nsrequest setHTTPMethod:requestType];
|
||||
|
||||
|
@ -190,8 +191,7 @@ static int processTask(HttpRequest *request, NSString* requestType, void *stream
|
|||
char* requestDataBuffer = request->getRequestData();
|
||||
if (nullptr != requestDataBuffer && 0 != strlen(requestDataBuffer))
|
||||
{
|
||||
NSString* requestData = [NSString stringWithUTF8String:requestDataBuffer];
|
||||
NSData *postData = [requestData dataUsingEncoding:NSUTF8StringEncoding];
|
||||
NSData *postData = [NSData dataWithBytes:requestDataBuffer length:request->getRequestDataSize()];
|
||||
[nsrequest setHTTPBody:postData];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue