Quantcast
Channel: Gurock Software Support Forum
Viewing all articles
Browse latest Browse all 829

POST request, 400 Bad Request Error - Content-Type header invalid

$
0
0

I am in the process of migrating a Testrail client to Testrail 3. I am following the migration guide and attempting to use JSON to send the requests. However, I am running into errors when using the add_run API method.

I am running this in RESTclient to debug.

The request I send is

POST index.php?/api/v2/add_run/1

(I have a project with id 1)

As request headers I am using

Content-Type: application/json

and

Authorization: Basic USERNAME:PASSWORD_BASE64

request body is:

    {
    "name":"name",
    "suite_id":1
    } 

Upon sending the request, I receive a "400 Bad Request" Response with the error message:

 {"error":"Content-Type header invalid (use Content-Type: application\/json)"}

Since I am in fact using

Content-Type: application/json

as a request header I have no idea why I am getting this error or what it means. Any ideas?


Viewing all articles
Browse latest Browse all 829

Trending Articles