I'm trying to use the HTTP output plugin to send a PUT request to a URL but getting a 400 message, and I can't figure out what I'm messing up.
I'm using Logstash v8 running in a Docker container.
I'm able to successfully make a PUT request using Postman App. This is the HTTP code that Postman generates which I'm using to configure the HTTP plugin in Logstash
PUT /v2/conversation/account/accountid1122/sendMessage HTTP/1.1
Host: endpoint.testing.com
Authorization: my auth code
Content-Type: application/json
Content-Length: 257
{
"recipients": [
{
"phone": "+1234567890",
"firstName": "Test",
"lastName": "Test"
}
],
"locationId": "myLocationID",
"msg": "API Test!",
"scheduledAt": null
}
My HTTP plugin looks like this:
http {
http_method => "put"
url => "https://endpoint.testing.com/v2/conversation/account/accountid1122/sendMessage"
headers => {
"Content-Type" => "application/json"
"Authorization" => "MyAuthCode"
}
message => '{
"recipients": [
{
"phone": "1234567890",
}
],
"locationId": "myLocationID",
"msg": "API Test!!",
"scheduledAt": null
}'
}
Logstash is throwing 400 error.
Encountered non-2xx HTTP code 400 {:response_code=>400, :url=>"https://endpoint.testing.com/v2/conversation/account/accountid1122/sendMessage", :event=>#<LogStash::Event:0x76181d9a>
What am I messing up?