Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans