0

I'm writing a program about create issues on gitHub. When I try to set the issue's release-date by using this API, I got a 400 response.

I tried different kinds of data(even empty issue list), but none of them worked.

part of my code:

self.host = config.get_str('zen_hub_host')
self.headers = {
    'X-Authentication-Token': config.get_str('zen_hub_token'),
}

....

response = self.session.patch(f'{self.host}'                                                   
                              f'p1/reports/release/{release_id}/issues',
                              json.dumps(data),headers=self.headers)

PS: I've checked host, token and release_id by trying 'GET /p1/reports/release/:release_id/issues'.

Error Message is : 'Invalid request , invalid issue in add_issues'.

I tried to set add_issues an empty list and add some issues to remove_issues but the error message did not change.

Leo Sun
  • 1
  • 1

1 Answers1

0

I got my answer. A different question but the answer fixed my problem:

Problem solved by adding 'Content-Type': 'application/json' to my headers

Leo Sun
  • 1
  • 1