0

Basically I would like to see an example on how to download a file.

I can't seem to find on phphttpclient website any doc or example about it.

In curl, the request would look like this:

curl -o hello.txt -H "X-Auth-Token: xxxxxxxxxxxxxxxxxxx" http://site_where_to download/hello.txt

Thanks.

  • phphttpclient is a REST client for parsing JSON, XML and HTML, not downloading files. For that I would recommend other libraries. – Kristian Vukusic Aug 19 '15 at 11:05
  • Hi Kristian, Could you point me to a PHP library (that you have used and are satisfied with it) for making REST requests and also DOWNLOAD files? – user3744490 Aug 19 '15 at 11:13
  • You have [Guzzle](https://github.com/guzzle/guzzle) or [Requests](https://github.com/rmccue/Requests) – Kristian Vukusic Aug 19 '15 at 11:39
  • Request seems like a nice alternative. For downloading I just write the response->body into a file (not sure if this is the best way, but it works). I am not sure though how to make a file upload using PUT. Any pointer on how to do this (can't seem to find anything about this in the doc). Thanks. – user3744490 Aug 19 '15 at 15:05

0 Answers0