Problem in getting response from webserver
- by Amarpreet
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.