How do I make a request using HTTP basic authentication with PHP curl?

Posted by Bedwyr Humphreys on Stack Overflow See other posts from Stack Overflow or by Bedwyr Humphreys
Published on 2010-01-26T15:42:18Z Indexed on 2010/05/19 7:10 UTC
Read the original article Hit count: 313

Filed under:
|
|
|

I'm building a REST web service client in PHP and at the moment I'm using curl to make requests to the service.

How do I use curl to make authenticated (http basic) requests? Do I have to add the headers myself?

If so I've got some other questions -

  1. Is there a REST library for php?

  2. or is there a wrapper for curl that makes it a bit more rest friendly?

  3. or am I going to have to continue to roll my own?

Thanks.

© Stack Overflow or respective owner

Related posts about php

Related posts about rest