0

Ciao, devo implementare chiamate REST nella mia app. Ho esequito la chiamata in POST e sempra che vada a buon fine; viene eseguito il success.

[self POST:@"url" parameters:parameters
       success:^(NSURLSessionDataTask *task, id responseObject) {

       } failure:^(NSURLSessionDataTask *task, NSError *error) {


       }];

The problem is that I do not know how to display the result of the call. Can you suggest something ?

  • What do you mean by "display the result of the call"? – Dree Jul 17 '15 at 14:16
  • If everything goes fine, the `responseObject` contains the JSON data received from the server. So in the `success` block, you can (maybe?) parse it depending on what you really want to do. If you need some detail about JSON serialization, I suggest you reading this thread: http://stackoverflow.com/questions/5547311/how-do-i-parse-json-with-objective-c. – Dree Jul 17 '15 at 14:22
  • the problem is that I can not understand that there are examples on the Internet and use them for what you need me . Could you give me an example starting on my code ?? I would save my life !!!! : p – Flavio Merolli Jul 17 '15 at 14:26
  • You're providing very few details about what you really need to do with your server response. Would you please be a bit more specific? If you just have to check wether the server call went fine, you can simply add `NSLog(@"Success")` into the `success` block and the message will be displayed in the debug area of Xcode. – Dree Jul 17 '15 at 14:32

0 Answers0