Sunday, 14 February 2016

JSON parsing using NSURLSession in iOS

In this tutorial , i will tell you about how to hit a web service in iOS using NSURL Session .
It is introduced in iOS 7 and it replaced the previous NSURLConnection . 


Now , lets begin with the steps : 



1)   Create the NSUrlSessionConfigration and then create a session with that configuration. This allows you to create a session with specific functions set on it.



2)   Create an NSUrlRequest so that you can set the request methods to hit the web service.



3)   Create a JSON representation of the dictionary you will post to the web service.



4)   Now code for this is : 




JSON parsing using POST method


JSON parsing using AF Networking 3.0


Thats all about NSURLSession.

Thank you :)

3 comments:

  1. Thank you so muchh !!! :) Worked for me thnks alot

    ReplyDelete
  2. Your welcome

    Keep reading my blog for more tutorials !!!

    ReplyDelete
  3. Thanks for this beautiful post IOS. It is really good for the beginners and I also liked the post.
    IOS Training in Bangalore
    IOS Training in Marathahalli

    ReplyDelete