Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

How to analyze add_result http 400


#1

We are trying to send add_result with a json from java and get a http 400 (TR log says “bad JSON”).

Is there a way to see what part of the JSON is “bad” ?

I did use JSONLINT to check and the JSON is valid.

Cheers,

MaC


#2

Hi MaC,

Thanks for your posting! Do you use one of our API bindings to access the API? The API bindings do not expect raw JSON but data structures depending on the language you use and you can find example for the different bindings here:

http://docs.gurock.com/testrail-api2/start

Regards,
Tobias


#3

Dear Gurock Team,

we are actually using the Restful API and sending a “raw” JSON.

We can of course switch to the Java binding, but we did not see any reasons not to use the Restful API.

Cheers,

MaC


#4

Hi MaC!

Can you please share the full HTTP request you send? Which tools do you use to send the request (e.g. curl)? You can also send this via email to contact@gurock.com in case you don’t want to share this here in the forum.

Thanks!

Regards,
Tobias