Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Rest API; Request works in postman but not HttpClient

Spencer Poole
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 11, 2022

Hello, everyone!

I am currently encountering a strange issue when trying to use the JIRA API and basic authentication.

I have made an http request that works successfully in postman and from my app in angularjs:
postmanrquest.png

However, I have now tried to replicate this request in my c# code for my web api and the request never seems to work. Sending the request from here doesn't reflect any use of the api token when checking my api tokens on the JIRA website.
apicode.png
I have replaced my base64encoded password here with $$$$ just for this post.

My response is always:response.png
Why would this request be working in postman but not in my c# code with httpclient? I have tried re-writing this many different ways.

1 answer

0 votes
Neil Mansilla
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 12, 2022

Hi @Spencer Poole. Welcome also to the user community!  :-)  Just an FYI, I saw your post on the Atlassian Developer Community forums earlier today, and sent over a suggestion to help debug the problem you're having:

https://community.developer.atlassian.com/t/rest-api-basic-auth-request-works-in-postman-but-not-httpclient/60641/2

p.s. Side note: be sure to change the URL in your C# code to call https, not http.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
atlassian, atlassian community, loom ai, atlassian loom ai, loom, atlassian ai, record recaps of meetings, meeting recaps, loom recaps, share meeting recaps,

Loom’s guide to great meetings 📹

Join us to learn how your team can stay fully engaged in meetings without worrying about writing everything down. Dive into Loom's newest feature, Loom AI for meetings, which automatically takes notes and tracks action items.

Register today!
AUG Leaders

Atlassian Community Events