envoyproxy / nighthawk

L7 (HTTP/HTTPS/HTTP2/HTTP3) performance characterization tool
Apache License 2.0
361 stars 81 forks source link

Send and receive json messages with nighthawk #810

Open MichalzDev opened 2 years ago

MichalzDev commented 2 years ago

Hi, Is there a way to POST and GET requests with json as a body ? Something like running nigthawk client with: --request-method POST --request-header 'Content-Type: application/json' and --request-body '{foo: bar}' I see in Readme there is only --request-body-size that is int. Same thing for nighthawk server is there a way to get json or other message instead of multiple a's ? Thanks :)

mum4k commented 2 years ago

Hi @MichalzDev as of now we don't have support for setting the request body, but I do agree that this would be an interesting feature to add.

We have a plan to work on this, but nothing concrete yet. I will update this issue if we get to implementing this feature.

MichalzDev commented 2 years ago

Hi @mum4k. Just to clarify, from server side setting option like response body is also not available ?

mum4k commented 2 years ago

@MichalzDev that is correct, both the client and the server currently just send the response_body_size times the a character. Here is the server portion.

With that said, adding a support for a custom response body is fairly trivial in both the client and the server. We do plan adding it into the client and a contribution to the server side would also be welcome if you are interested.