php - Am I using Yfrog's API correctly to make a HTTP request with POST data? -
I'm trying to use YFrog's API I think I'm using it correctly so that An HTTP post request is of the content type XML. However, as a reaction body, I always get a 404 error for some reason. Here's their API:
PHP code is my attempt to upload.
$ data = array ('media' = & gt; 'http: // img253 Imageshack.us/my.php?image=bfab82a545d414uo.jpg', 'Username' = & gt; ; 'Esque', 'password' = & gt; 'ac', 'message' = 'gtc: mediawiki;' hi '); $ Url = 'http://yfrog.com/api/uploadAndPost'; $ Req = New HTTPRequest ($ url); $ Req-> Ad header (array ("content-type" = & gt; "text / xml")); $ Req-> SetMethod (HTTP_METH_POST); $ Req-> AddQueryData ($ data); $ Req-> Send (); Echo $ req-> getResponseBody (); It also says for the media that "binary image data" means that the image placement URL can not be passed to it? what is the meaning of this?
Thanks for any help?
I think the problem is basically that when you give the url posted above ImageShack does not return a binary file. For me, it gives an HTML document.
I think you should try to give a binary file as the "media" parameter that the photo you are trying to obtain uses this place.
This is the reaction I originally tried:
head / my .php? Image = bfab82a545d414uo.jpg HTTP / 1.1 Host: img253.imageshack.us HTTP / 1.1 200 OX X-Power-By: PHP / 5.2.6 Set-cookie: nopopunder = 1; Expiration = Master, 07-May-2009 11:10:21 GMT; Path = /; Domain = .imageshack.us X-UA-Compatible: IE = EmulateIE7 Content-Type: Text / html
Comments
Post a Comment