Comments (6)
@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.
from wrk2.
Hi @mpabbidi ,
did you figure out the above option with wrk ? , if so request you share the steps
Thanks
from wrk2.
Also interested in learning how to send a JSON type body with wrk...
from wrk2.
Thanks man will give that a go when I'm next doing some stress testing
from wrk2.
@wandenberg should {"Content-Type": "application/json"}
actually be {["Content-Type"]= "application/json"}
?
from wrk2.
Correct @rex-remind101
Thanks for noticing. I edited the example to make it easier.
from wrk2.
Related Issues (20)
- Run Make without Lua Script
- [question] wrk2 support http2?
- Req/Sec reports nan HOT 1
- Unsupported target architecture - arm64 M1 Mac HOT 4
- wrk2 installation failed on Mac OS Monterey and Apple M1 Max chip HOT 3
- What's the unit of latency used in lua scripting? HOT 1
- Cut off a release?
- How to import hmac to lua script?
- How -R works and why I can't corellate resulting Requests/sec with it? HOT 5
- Web/Desktop Application to load histogram data from wrk2
- How to associate response with request in Lua script
- Are there plans to port the code to the windows platform HOT 3
- more a question than an issue ...
- can not make.
- does wrk2 supports tlsv1.3 over https?
- Question
- wrk2 produces incorrect results HOT 5
- add windows platform support
- Sampling latency
- Cannot build on MacOS Sonoma 14.4.1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wrk2.