Problem in getting response from webserver

Posted by Amarpreet on Stack Overflow See other posts from Stack Overflow or by Amarpreet
Published on 2010-05-31T08:01:19Z Indexed on 2010/05/31 8:02 UTC
Read the original article Hit count: 236

Filed under:
|

Hi guys

I am sending data to webserver in the Querystrings by creating URL dynamically. When I view that URl in UIAlertView it shows me correct one.

And when i try to get response using NSURL code, it does not respond. Below is the code.

NSString *uu = @"http://www.zenhomeenergy.com/ZenIphoneServUpdate.aspx?CustomerID=12&FirstName=Andrew&LastName=Turner&State=SA&Street=60 Highfiled Drive Hillbank no phone number&PostCode=5112&Email= &Mobile= &HomePhone= &WorkPhone= &PrimaryResidence=True&HomeOwner=True";

NSString *text = [NSString stringWithContentsOfURL:[NSURL URLWithString:uu]];

if(text)

{

if([text isEqualToString:@"Success."])

{

textView.text = [textView.text stringByAppendingString:@"Success.\n"];

}

else

{

textView.text = [textView.text stringByAppendingString:@"Failed.\n"];

}

}

If you try putting the above URL into browser it says "Success." But the code above doesnot work.

Please Help.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk