Graph sometimes returns html response even when json is requested
We have a golang application which uses graph SDK to do exchange/onedrive/sharepoint API calls. We set Accept
header to application/json
. But sometimes, graph server returns responses in text/html
format, which causes content type text/html does not have a factory registered to be parsed
error in the graph SDKs code which processes the response.
Can MSFT please fix this on graph server end? Or maybe provide a mechanism in the graph SDK to format this response as json and pass it down to the application? Right now we cannot track & interpret these responses since we see a blanket content type text/html does not have a factory registered to be parsed
error, which is not really of much use.
E.g.
- Do a
GET https://graph.microsoft.com/v1.0/users/user-id/message/message-id
request to graph. - Graph sometimes returns html response. An example below.
- We see this behavior across services, not just exchange.
- This is not a client side error.
X-Ms-Ags-Diagnostic: {"ServerInfo":{"DataCenter":"..."}}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Service Unavailable</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Service Unavailable</h2>
<hr><p>HTTP Error 503. The service is unavailable.</p>
</BODY></HTML>