javajsonapiplivo

error : use 'application/json' Content-Type and raw POST with json data


The error message

error : use 'application/json' Content-Type and raw POST with json data

is being appeared from cyclos application inside plivo console which a third API that need to be integrated in cyclos through

Gateway URL: https://api.plivo.com/v1/Account/auth-id/Message/

HTTP username:xxx

HTTP password: **** 

HTTP headers

{
      'content-type': 'application/json',
}

HTTP request type: POST

HTTP request POST body

{
    "src":"+xxxx",
    "dst":"+xxx",
    "text":"some test"
}

Solution

  • Can you try sending header as 'Content-Type' instead of 'content-type'.

    There are some implementations where field-names are case-sensitive (Like an age-old bug in PHP!).