简体   繁体   中英

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"
}

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!).

Just putting

Content-Type: application/json

inside http header field solved the issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM