Accessing very long URLs from PHP |
Accessing very long URLs from PHP |
Brian Chandler |
Feb 12 2009, 02:45 PM
Post
#1
|
Jocular coder Group: Members Posts: 2,460 Joined: 31-August 06 Member No.: 43 |
The other day I discovered the wonders of the Google chart API, and here's my sample:
http://chart.apis.google.com/chart?chs=300...2|100,100|50,50 I'm trying to make a local copy (since I only need to generate the chart every so often), but both the PHP copy() function and the CURL library seem to choke on a URL of this length -- Google returns 400 Bad Request. I guess it is being chopped off at 512 characters [?], since it seems to be able to access the following shorter chart OK: http://chart.apis.google.com/chart?chs=300...2|100,100|50,50 Any suggestions for a quick way around this? Separate question.... Can't find anything at Google about character encoding for text captions etc. Does anyone know if it accepts UTF-8 or whatever? |
Brian Chandler |
Feb 15 2009, 01:39 PM
Post
#2
|
Jocular coder Group: Members Posts: 2,460 Joined: 31-August 06 Member No.: 43 |
Just to answer my own question: I tried fopen(), I tried CURL, I tried using POST to send the parameters (doesn't work), and I tried calling wget....
Then I realised that I had html-ified the URL, with & in place of & ... so no wonder it wouldn't work. Grr! |
Lo-Fi Version | Time is now: 26th April 2024 - 12:53 AM |