Skip to content

Conversation

@xiaobiaozhao
Copy link

post_json.lua

local cjson = require "cjson"
local json_encode = cjson.encode
local json_decode = cjson.decode
wrk.method = "POST"
wrk.body = json_encode({ ["key"] = "value" })
wrk.headers["Content-Type"] = "application/x-www-form-urlencoded"
  1. wrk can use lua's built-in json library to do json encode&decode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant