Pass Requset Body to Http_Poller

I am able to connect to my services using http_poller for all the GET services.

I have some POST service to monitor which accepts a json body

Input -
{
"AreaCode": "111",
"CountryCode" : "01",
"Number": "1231231"
}

How can I pass this request ?

I tried this but got 400 - Bad Request. Saw my appln. logs, the input request was null.

mapping =>
{
"body" =>
{
AreaCode => "111",
CountryCode => "01",
Number => "1231231"
}
}

The format is wrong. Couldnt get the precise one. Please help.

Can anyone please provide an update on this ?

Got one step ahead. Corrected the request body -

body => '{ "AreaCode": "123","CountryCode": "01","Number": "1231231" }'

But now I am getting "response_message" => "Unsupported Media Type".

I have already specified it in the header -

headers => { Accept => "application/json" }

What am I missing here ?

1 Like

Got the fix.

Replaced in the header section -

"Content-Type" => "application/json"

1 Like