Add JSON support
Thanks for your PR - I'm not going to merge it at the moment, because I think a better way of handling this (and other options that are really just custom options to pass to curl) is https://github.com/jaygooby/ttfb.sh/issues/9
I've just pushed up that -o option, but I understand that having a bit of syntactic sugar is nice too. Let me have a think...
👋 Can I ask what it is that you're testing with this, because there are really two changes - the first is that you're measuring TTFB from a POST request and the second is that the payload is JSON.
Currently we only support GET requests, so it's not an unreasonable change...
@jaygooby, thanks for the quick reply! 😃 In my case, I would like to measure performance changes in REST API. As you might know, when we would like to send a JSON payload, we have to use the POST method. When we are providing a payload with -d flag, cURL changes the method to POST, the reason is that most of the server's implementations accept payload only with the POST method even if an endpoint is designed to read the data (similarly to GET method). So, IMO providing an option to send a payload in JSON format would be a handful for developers in case to test read-only endpoints which require such input.