title: What response do I send when my web api can't perform an action due to 3rd party service
body: <p>I'm working on a C# Web API written in dotnet core.  I'm struggling with the return of an action that attempts to retrieve data from a 3rd party service on another server.  In the event that something goes wrong while attempting to get data from said 3rd party service, the HTTP response that made the most sense to me when looking at the <a href="https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-p2-semantics-19#section-7.5.3" rel="nofollow noreferrer">spec</a> was 502 Bad Gateway because</p>
  <blockquote>
  <p>The server, while acting as a gateway or proxy, received an invalid
  response from the upstream server it accessed in attempting to
  fulfill the request.</p>
  </blockquote>
  <p>But I can't find a way to return this in my action.  <code>IActionResult</code> doesn't seem to have an implementation for this code.  Am I thinking this through correctly?</p>