Re: php call from Cocoa
Re: php call from Cocoa
- Subject: Re: php call from Cocoa
- From: j o a r <email@hidden>
- Date: Wed, 21 Sep 2005 14:28:32 +0200
On 21 sep 2005, at 14.20, Lorenzo wrote:
I have to call a php script on my web server
http://www.dom.com/get.hph
it returns a string. Actually I call
phpPath = [NSURL URLWithString:@"http://www.dom.com/get.hph"];
response = [NSString stringWithContentsOfURL:phpPath
encoding:NSUTF8StringEncoding error:&error];
It works sometimes. Many times it returns nil (but the error code
is still
zero). We have already spoken here that instead of using
stringWithContentsOfURL it is better to use NSURLConnection, but
before I
implement it, I would like to know whether there is a better way.
Could it be that it returns *nil* because the string is not in UTF8
format? Try with Latin1 and see how that works. You would get better
feedback using NSURLConnection.
Also NSURLConnection is asynchronous while I need immediate feedback.
What do you mean with "immediate"? Making it synchronous probably
doesn't make it any faster.
j o a r
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden