Closed saefullohmaslul closed 4 years ago
Solved.
I'm using this code:
payload := map[string]string{
"body": "body",
}
body, _ := json.Marshal(payload)
header := http.Header{}
header.Set("content-type", "application/json")
targeter := vegeta.NewStaticTargeter(vegeta.Target{
Method: "POST",
URL: "http://localhost:9100/endpoint",
Header: header,
Body: []byte(body)
})
Question
is there an example of using vegeta as a library that requires certain headers to send POST requests?
When sending POST we use the following code:
How to add the header?