IOS ASIHttpRequest get & PHP

Recommended for you: Get network issues from WhatsUp Gold. Not end users.
OBJECT C :
-(void)getTest
{
    NSString *strURL = [[HttpCom SR_Root] stringByAppendingFormat:@"Test/get_test?par1=%d&par2=%@",10,@"123"];
    NSLog(@"URL:%@",strURL);
    NSURL *URL = [NSURL URLWithString:strURL];
    ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:URL];
    [request startSynchronous];
    if (request.error == nil) {
        NSString *string = request.responseString;
        NSLog(@"getTest:%@",string);
    }else{
        NSLog(@"%@",request.error.description);
    }
    
}

PHP :

function __construct()
		{
		parent::__construct();
		}
	
	
	public function Get_test()
	{
		echo "get_test";
		 $par1 = $_GET["par1"];
		 $par2 = $_GET["par2"];
		 echo "par1:".$par1;
		 echo "par2:".$par2;
	}



Result:

getTest:get_testpar1:10par2:123


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Jeffrey at January 09, 2014 - 7:46 AM