NSMutableURLRequest body malformed after iOS 8.3 update

前端 未结 3 2298
眼角桃花
眼角桃花 2021-02-19 05:47

Before today\'s iOS 8.3 update I had my code working right, but after updating server started rejecting requests as it could not find JSON data.

I found that iOS is sen

3条回答
  •  暖寄归人
    2021-02-19 06:29

    I put the comment as answer here:

    Try to indicate the http method like

    [request setHTTPMethod:@"POST"]
    

    and / or, the request length

    [request setValue:postLength forHTTPHeaderField:@"Content-Length"]; 
    

    and / or the content type

    [request setValue:@"application/"forHTTPHeaderField:@"Content-Type"];
    

提交回复
热议问题