ios - The network connection was lost when calling PHP API -


    var submitdic = nsmutabledictionary ()     submitdic.setobject (loginmerged, forkey: "module" )     submitdic.setobject (kedahe-tutorapp, forkey: "wskey" )     submitdic.setobject (112211, forkey: "passwd" )     submitdic.setobject (form04, forkey: "username" )      var request : nsmutableurlrequest = nsmutableurlrequest()     request.url = nsurl(string: http://kedah-etutor.com/component/module/ws_function2.php)     request.httpmethod = "post"     request.httpbody = nsjsonserialization.datawithjsonobject(submitdic, options: nsjsonwritingoptions() , error: nil)     println(nsjsonserialization.datawithjsonobject(submitdic, options: nsjsonwritingoptions() , error: nil)?.description)     request.setvalue("application/json; charset=utf-8", forhttpheaderfield: "content-type")      nsurlconnection.sendasynchronousrequest(request, queue: nsoperationqueue.mainqueue(), completionhandler:{ (response:nsurlresponse!, data: nsdata!, error: nserror!) -> void in         var error : autoreleasingunsafemutablepointer<nserror?> = nil          if data != nil         {         } 

i have tried call php json web service, returns null data , error description keep mention "the network connection lost". besides, in java httpclient framework works php web services.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -