For the R bindings, we have a popular debugging mode to 'dry-run' a http request. By this we mean that the user builds and performs a http-request in the regular way, but instead of actually connecting to the requested host, we trick libcurl to make the http request to a local server, which records the full payload that libcurl has uploaded, and we return this blob to the user.
Currently the way this is implemented is a bit cumbersome. We first start a http-server in the background. Then we take the handle provided by the user, and replace CURLOPT_URL to substitute the host with "http://localhost". Then we modify CURLOPT_HTTPHEADER to set the 'Host' request header to the host:port that was specified by the user in the original url, and let libcurl perform the request. The fake server always returns 200. Especially the part where we need to run our own http server is a bit annoying. I was wondering if there would perhaps be a simpler method trick libcurl to send a http request to a local file or buffer, from where we can read it. Preferably something that we can do entirely in C (things like nc are difficult to port). -- Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library Etiquette: https://curl.se/mail/etiquette.html