iphone - NSURLResponse returning null when userName is wrong in url -



iphone - NSURLResponse returning null when userName is wrong in url -

hi written simple method restfull service please find below code using

-(nsinteger)sendrequesttourl:(nsstring*)url andtype:(nsstring*)type{ nsmutableurlrequest *request=[[[nsmutableurlrequest alloc] initwithurl:[nsurl urlwithstring:url]] autorelease]; [request sethttpmethod:type]; nsurlresponse *response=nil; nserror *error=nil; nsdata *responsedata=[nsurlconnection sendsynchronousrequest:request returningresponse:&response error:&error]; nshttpurlresponse *httpresponce=(nshttpurlresponse*)response; homecoming [httpresponce statuscode]; }

when trying nail http://serverip:8082/kitabooadapter/services/kitaboo/login?username=learner&password=olat giving me nshttpurlresponse *httpresponce instance can status code.coming other scenario whenever trying utilize other learner in url httpresponce giving me null getting 0 status code.

expected: whenever modify "learner" in url status code must 401(unfortunately giving me 0 )

*question:*what might reason giving me httpresponce null.is there guess may problem in server?

please provide me guess on this.thanks in advance.

iphone objective-c ios web-services

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -