m6w6 / ext-http

Extended HTTP Support
BSD 2-Clause "Simplified" License
79 stars 22 forks source link

Notify observers before any request is built #58

Closed gooh closed 6 years ago

gooh commented 7 years ago

I would like to modify outgoing requests and inject custom http headers.

While I can specify an observer receiving any such requests, the first notification happens in https://github.com/m6w6/ext-http/blob/master/src/php_http_client_curl.c#L2194, e.g. after the request was built. Changing the request at this point in time, will not have any effect.

Can we add a prepare stage that notifies the observer before the request is build?