- call-with-response request writer readerprocedure
Low-level interface. The request argument must be an intarweb request object. The writer argument is called with an output port and should write the request body. The reader argument is called with the intarweb response object, whose port contains the response body.
Returns three values: the reader result, the request URI, and the intarweb response object.
(import intarweb uri-common) (let* ((uri (uri-reference "https://httpbin.org/post")) (headers (headers '((content-type #(application/json ()))))) (request (make-request uri: uri method: 'POST headers: headers))) (call-with-response request (lambda (out) (display "{\"key\":\"value\"}" out)) (lambda (response) (read-string #f (response-port response)))))