Hello,
Ive been trying to create issues in Jira using JAVA and Oauth . I followed the tutorial and using the sample oauth client provided in the below link:
I am able to successfully send GET requests and have also added DELETE which is working great, but im not able to figure out how to submit a POST request. The code im using is below:
private static HttpResponse postResponseFromUrl(OAuthParameters parameters, GenericUrl jiraUrl, String requestBody) throws IOException {
HttpRequestFactory requestFactory = new NetHttpTransport().createRequestFactory(parameters);
HttpRequest request = requestFactory.buildPostRequest(jiraUrl, ByteArrayContent.fromString(null, requestBody));
return request.execute();
}
When i run the above, i get a 401 error with no other detail. I thought it might have to do with a json formatting but I am able to successfully create issues with basic authentication using POSTMAN. But when i attempt to POST using the OAuth sample project, i get the 401 error which is odd, as I can DELETE and GET just fine.
Would really appreciate any advice.
Many thanks
@[deleted] I also get the same issue. Did you get this resolved?. I dont see any answers in https://community.developer.atlassian.com either.
This looks like a developer question, so it would be better to post it at https://community.developer.atlassian.com, that's where our developer community hangs out :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.