that's what I'm trying to tell you. Its NOT the same. It's different in some way, it's sending a cookie, you've messed up the URL, you've encoded something wrong, there is a header you missed, I have no idea what the thing is but something is different. stringWithContentsOfURL: is a simple method which does simple things, if this request is really just a simple GET url then that method will work if you give it the right URL and no other state information is required.

You're basically trying to say that you have a simple URL you want to send but stringWithContentsOfURL: doesn't work so how else can you send a simple URL in a way which does work. But for simple independent URLs, stringWithContentsOfURL does work, really it does, so either you're not sending the right URL or you've encoded it wrong, or there is more in there (like a cookie, like a header, like something) which you need to add. You need to figure that difference out first before you can work out which method you need which is rich enough to send all the information you need to send.

Go snoop the network and find out what the difference is between the browser and your call.

On 27-Oct-2009, at 11:35 PM, James Lin wrote:

The sticky point right now is: the same url string used with stringWithContentsOfURL works perfectly when accessed using a browser.
Which means my php script is in perfect working order.

But when accessed using stringWithContentsOfURL, then it doesn't work!

I can tell my ISP is not going to take up the responsibility for this one, because it works in a browser...

That's why i am asking for alternatives to stringWithContentsOfURL...

James
On 2009/10/27, at 下午11:25, Roland King wrote:


On 27-Oct-2009, at 11:16 PM, Dave Carrigan wrote:


On Oct 27, 2009, at 8:11 AM, James Lin wrote:

Hi all,

I am still having the mysterious error of "Internal Error 500" message returned from stringWithContentsOfURL.

If "Internal Error 500" is the contents of the string after you create it using +stringWithContentsOfURL, then the problem is with the server, and changing to use something else is not going to change that fact.



Exactly. You need to go find out what is being sent to the server when you use that method and why it's erroring. You're missing a parameter or you encoded something wrong or there's a cookie you need to set or something. There is nothing wrong with the cocoa method, you're either not setting it up right, or you need to add more stuff or it's possible that the request does need things that stringWithContentsOfURL: can't add, but at this point you haven't figured that out and don't know what, if anything they are, so no other method will help you.

The error log from the server would be of use.

HTTP is simple. Look at what you're sending out with some kind of snoop between your non-cocoa way and your cocoa way, the answer lies there.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to