Open mpabbidi opened 8 years ago
Hi @mpabbidi ,
did you figure out the above option with wrk ? , if so request you share the steps
Thanks
Also interested in learning how to send a JSON type body with wrk...
@suni1mp and @GrayedFox you can write a lua script and configure the wrk.body and wrk.headers. something like
wrk.headers["Content-Type"] = "application/json"
wrk.body = '{"my":"json"}'
or in a dynamic way
request = function()
wrk.format(method, path, headers, body)
-- you can create the values dynamically here using lua
return wrk.format('POST','/resource/path', {["Content-Type"]= "application/json"}, '{"my":"json"}')
end
I got this information from here It also recommends for performance to create your requests first if they have a lot of logic.
Thanks man will give that a go when I'm next doing some stress testing
@wandenberg should {"Content-Type": "application/json"}
actually be {["Content-Type"]= "application/json"}
?
Correct @rex-remind101 Thanks for noticing. I edited the example to make it easier.