Sending a JSON via POST in NSURLRequest

前端 未结 4 2023
轻奢々
轻奢々 2020-12-08 17:07

I have a problem with sending a JSON to a Server with REST API. This is the code i use:

NSString *jsonPostBody = [NSString stringWithFormat:@\"\'json\' = \'{         


        
4条回答
  •  猫巷女王i
    2020-12-08 17:54

    I think you have to use a JSON framework and convert jsonPostBody to it's JSON representation before sending it. Check this accepted answer , it shows how to build the request.

提交回复
热议问题