Please note that you cannot write to a HTTP resource, for example for doing a PUT request.
You will get this error: 'Failed to open stream: HTTP wrapper does not support writeable connections'
To do a PUT you can only populate the 'content' key of the HTTP context, or use Curl instead.