xcode send post parameters with URL

Hello Developers



How are you?


I am a new developer at all and only 2 weeks working with Objective-c. I came from VoIP PBX World, knows little bit php, shell


So my question is:


I am working right now on Bill application for mobile operator

To send parameters in a blind mode by xcode

I installed POSTER Plugin to my Firefox that can emulate login with 2 parameters (login and password) to this web site and

return me a content from my account there.


So I don't know which instrument in XCODE can do the same as POSTER PLUGIN.


I have a link where I send parameters

"https://www.golantelecom.co.il/rpc/web.account.rpc.php?action=login&p_action="


and parameters I sent


Content-type: application/x-www-form-urlencoded


username=123456&password=PASSWORD


I can't send it from my browser like a get request in this case

https://www.golantelecom.co.il/rpc/web.account.rpc.php?action=login&p_action=use rname=123456&password=PASSWORD it's not working


How I can emulate this same from Xcode?


Very appreciate for your help

iPhone 5, iOS 6.1.3

Posted on Apr 5, 2013 11:19 AM

Reply
2 replies

Apr 6, 2013 4:51 AM in response to !#

Hi,


For this thing, you dnt need to use any plugin. What you can do is take the "username=123456&password=PASSWORD" text into string format. And convert that into some encoded format. Ask the server people decode the content what you are sending from device. Check the iPhone Code. May it works...



Eg:


NSMutableURLRequest *req = [[[NSMutableURLRequest alloc] init]autorelease];

[req setURL:[NSURL URLWithString:url]];


[req setHTTPMethod:kPOST];

[req setHTTPBody:[postParam dataUsingEncoding:NSUTF8StringEncoding]];


NSURLConnection *connGet = [[[NSURLConnection alloc]initWithRequest:req delegate:self] autorelease];

if(connGet)

{


NSLog(@"Connected successfully");

}

else {


[AppDelegate showAlert:kAlertUnableToConnect];

NSLog(@"Not connected successfully");


}



Thanks,


Rajesh..

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

xcode send post parameters with URL

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.