import vibe.core.log; import vibe.http.client; import vibe.http.form; import vibe.stream.operations; void sendForm() { requestHTTP("http://example.com/form", (scope req) { req.method = HTTPMethod.POST; req.writeFormBody(["field1": "value1", "field2": "value2"]); }, (scope res) { logInfo("Response: %s", res.bodyReader.readAllUTF8()); }); }
Writes a vibe.http.client.HTTPClientRequest body as URL encoded form data.