Forum Discussion
TP-101
Helper I
2 years agoM Query Post REST API, return format not JSON with Expression.Error
I'm attempting a POST to a REST API which should return data in JSON. The POST appears to succeed however, receiving an Expression.Error trying to convert the response to binary. Can this query be ...
lbendlin
Super User
2 years agoTry adding an accept directive.
TP-101
Helper I
2 years agoAdded the accept and still observing the same Expression.Error.
GetJsonQuery = Json.Document(Web.Contents("https://" & #"Tenant" & #"GetMetric", [Headers=[Authorization=AccessTokenHeader, #"accept"="application/json"], Content=Text.FromBinary(Json.FromValue(data))]))- lbendlin2 years ago
Super User
Try this.
GetJsonQuery = Json.Document(Web.Contents("https://" & Tenant & GetMetric, [Headers=[Authorization=AccessTokenHeader, Accept="application/json"], Content=Text.FromBinary(Json.FromValue(data))]))You will also need to read up on RelativePath and Query.