Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum
Unanswered

SysHttpCommunicationClient getting response on error

Posted on by 15
I'm using the SysHttpCommunicationClient to call a restful service and get a response. I get a HttpResponseMessage as expected when the call is successful but the response message is null on an unsuccessful call, such as a status 400 (bad request). Instead an exception of type System.Exception is being thrown. 
 
There is a response message being sent back as I can see it in Postman.  The response message contains information about what was wrong with the request, such as what field was invalid. I'd like to be able to get the response message on an error status so I can share the information with the user. 
 
How can a the HttpResponsemessage when the service returns a status other than 200?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,564 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,651 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans