Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Kareny

macrumors newbie
Original poster
Jun 21, 2010
22
0
Hey guys,
I have a problem about HTTP GET in objective-C.
I added two parameters followed by a website, and then upload to a web service.
For example:
NSURL *url = [NSURL URLWithString:mad:"http://www.mywebsite/Upload?parameter1=value1 & parameter2=value2"];

and the code works fine, I can get parameter1 and parameter2 on my web service.

My questions is how can I change the parameter to a Textfield.text?

Thanks very much!!!
 
NSURL *url = [NSURL URLWithString:mad:"http://www.mywebsite/Upload?parameter1 & parameter2"];
You sure the URL doesn't look something more like @"http://www.mywebsite/Upload?parameter1=value1& parameter2=value2" ? That's how a normal URL includes parameter values.

My questions is how can I change the parameter to a Textfield.text?
You should look into how to format a string to include an argument list. I'd start by looking at the String Programming Guide.
 
You sure the URL doesn't look something more like @"http://www.mywebsite/Upload?parameter1=value1& parameter2=value2" ? That's how a normal URL includes parameter values.


Yes, it is parameter1=value1 & parameter2=value2!!:p Thanks for the correction!
 
You sure the URL doesn't look something more like @"http://www.mywebsite/Upload?parameter1=value1& parameter2=value2" ? That's how a normal URL includes parameter values.


You should look into how to format a string to include an argument list. I'd start by looking at the String Programming Guide.

Thanks a lot!! I got the solution and the problem is solved:D
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.