Re: Alternative to stringWithContentsOfURL

2009-10-27 Thread Dave Carrigan
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

Re: Alternative to stringWithContentsOfURL

2009-10-27 Thread Roland King
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

Re: Alternative to stringWithContentsOfURL

2009-10-27 Thread James Lin
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

Re: Alternative to stringWithContentsOfURL

2009-10-27 Thread jonat...@mugginsoft.com
I would fire up a protocol analyser like tcpdump or wireshark and see how the requests differ - particularly the headers. Regards Jonathan Mitchell Developer http://www.mugginsoft.com On 27 Oct 2009, at 15:35, James Lin wrote: The sticky point right now is: the same url string used with

Re: Alternative to stringWithContentsOfURL

2009-10-27 Thread Jean-Daniel Dupas
If you want something closer than what the browser does, use the URL Loading System: http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html Le 27 oct. 2009 à 16:35, James Lin a écrit : The sticky point right now is: the same url string

Re: Alternative to stringWithContentsOfURL

2009-10-27 Thread Roland King
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

Re: Alternative to stringWithContentsOfURL

2009-10-27 Thread Jeremy Pereira
On 27 Oct 2009, at 15:11, James Lin wrote: Hi all, I am still having the mysterious error of Internal Error 500 message returned from stringWithContentsOfURL. I am using stringWithContentsOfURL to call a php script that add an entry to MySQL database. My ISP claims that they have

Re: Alternative to stringWithContentsOfURL

2009-10-27 Thread Jens Alfke
On Oct 27, 2009, at 8:35 AM, 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. Dude, I answered this for you last week, explaining

Re: Alternative to stringWithContentsOfURL

2009-10-27 Thread Andy Lee
On Oct 27, 2009, at 11:11 AM, James Lin wrote: I am still having the mysterious error of Internal Error 500 message returned from stringWithContentsOfURL. Are you passing the URL you think you are passing? If you put this line in your code NSString *result = [NSString

Re: Alternative to stringWithContentsOfURL

2009-10-27 Thread John Pannell
Hi James- From your description (Internal Error 500) it sounds like the request you are sending is not working when submitted to the server. Make sure any strings used to form the URL for the request are passed through stringByAddingPercentEscapesUsingEncoding: What follows is likely

Re: Alternative to stringWithContentsOfURL

2009-10-27 Thread Jens Alfke
On Oct 27, 2009, at 4:40 PM, John Pannell wrote: Some web servers are configured to compress the reply (i.e. zip/ gzip) for transmission, and then the client will decompress and display. NSString is not a client that is prepared to do this, however. Here is some old code: Are you sure

Re: Alternative to stringWithContentsOfURL

2009-10-27 Thread Wim Lewis
On Oct 27, 2009, at 8:16 AM, Dave Carrigan wrote: On Oct 27, 2009, at 8:11 AM, James Lin wrote: 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

Re: Alternative to stringWithContentsOfURL

2009-10-27 Thread Roland King
I would agree that the gzip is not likely his issue. If the server were sending a gzipped response he wouldn't get an Internal Error 500 string in his response, he'd get a bunch of garbage zipped data. The only way in which that *might* be an issue is if the server were set up *only* to send