I currently use the exclusively contextual functionality of the PHP stream (see http://us2.php.net/manual/en/function.stream-context-create.php ) to access HTTP resources, and I was able to successfully use it for execute PUT, DELETE, POST, manage cookies and do everything I need. I initially started using it because I had SSL issues with earlier versions of CURL for Debian PHP (the Apache process had a problem with double-initializing OpenSSL, which was a mistake when trying to access SSL URLs): they probably fixed, but I do not know had the opportunity to go back.
In discussions with a friend, he argued that cURL api is faster / better, so I wanted to ask: is there any experience / knowledge about which option is superior and how?
In terms of performance, cURL wins a lot consecutively . I will not deny that it is harder to use, and it may not matter for general use, but the difference was quite dramatic, and I thought it was worth noting.
The streams in my experience are pretty neat. You probably already know this, but here the message in streams with a twist in case of not:
http://fabien.potencier.org/article/44/php-iterators-and-streams-are-awesome
Curl is nice, fast and simple; but I honestly would not prefer one or the other for performance reasons. I have never measured, but I doubt that this makes a big difference compared to the overhead of executing a remote request in the first place.