gurock / trcli

TR CLI (trcli) is a command line tool for interacting with TestRail.
Mozilla Public License 2.0
47 stars 42 forks source link

Request "GET" ask to include header "Content-Type: application/json". #105

Closed AgustinFlores11 closed 1 year ago

AgustinFlores11 commented 1 year ago

TestRail CLI Version

1.3.1

CLI Environment

Windows 10 Enterprise, python 3.9

TestRail Version

v5.7.1.4028

TestRail Instance Type

NA

Current behavior

I create a config file with my auth data, the host, and all data about the project-suite. When i try to upload an xml report file to my Testrail test run, i get the follwing result:

Checking project. Error detected while checking a project: 'Content-Type header missing (use Content-Type: application/json)'

Desired behavior

After trying to upload an xml report file, the trcli should check the data about the project, suite and test cases online and update the resuls in the desired test run.

More Details

Checking the code of api_client.py, i found headers where no added to requests of type "GET". Apparently this cause the error, i just add the headers to this request (as a test) and the upload was successful after that.

AnastasiaOMatveeva commented 1 year ago

How to solve this problem?

smartuuu commented 1 year ago

We have the same issue with Testrail v6.0.0. Modified api_client.py file and made a new build. It works now. Please fix it. image

Testinator-X commented 1 year ago

@d-rede can you add this changes to the planned version 1.4.0?

d-rede commented 1 year ago

@AgustinFlores11 @AnastasiaOMatveeva @Testinator-X

The headers are being added as of today's release v1.4.2. I hope this resolves the issue, but please open a new ticket if you still have problems.