Call JIRA API to create issue prompt xsrf check failed

1. Check whether the client sending the request is httpclient or resttemplate in spring. It’s better to use resttemplate (I just want to replace the client). The request header is as follows. The rest is mei’jia

HttpHeaders headers = new HttpHeaders();
headers.add("X-Atlassian-Token", "no-check");
headers.add("Authorization", JIRA_API_AUTHORIZATION);
headers.add("Content-Type", "application/json");

2. Add configuration in the request header( headers.add (x-atlassian-token, no check); this is the advice given in the official document

3. Modify the user agent in the request header

It’s better to deal with the above items. Generally, this problem can be solved. In addition, post several JIRA API documents.

(create issue) https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api -Rest-api-2-issue-post headers.add (“Authorization”, JIRA_ API_ AUTHORIZATION))

(JIRA official document on security certification related content) https://developer.atlassian.com/server/framework/atlassian-sdk/atlassian-rest-api-design-guidelines-version-1/

(questions from others in JIRA community) https://community.atlassian.com/t5/Jira-questions/Jira-7-rest-api-XSRF-check-failed-for-post-issue-with/qaq-p/488706

Similar Posts: