serf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Erenkrantz <>
Subject Re: example code POST with json body
Date Tue, 16 Mar 2021 20:30:25 GMT
Hi Andrew,

You can pass in the -f and -m options to serf_get to send a POST request -

% ./serf_get -m POST -f your.json

Take a look around setup_request (lines 347) and the options parsing around
lines 617:

If you have the JSON blob in memory rather than on disk, you can replace
the file bucket with a memory bucket, etc, etc.

Depending upon what is on the other end, you may also need to set request
headers as well indicating the content-type of the body.

Cheers.  -- justin

On Tue, Mar 16, 2021 at 6:20 AM andrew klassen <>

> Sorry to bother you but I am not able to find example code for client side
> POSTrequest. Specifically, I need to send POST messages with a json body. I
> see severaluses of GET in the tests directory.
> Thank you for any help,Andrew

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message