I'm attempting to return a json string as a httpresponsemessage from this Web Api. Other forums informed me of the stringcontent feature to load strings in various formats into a string content object that extends the http content, however, my http response message body is populated with all the headers formatted into json instead of the actual response body from the api.
Dim ws As New RoXAPI
Dim wsResponse As String = ""
Dim doc As XmlDocument = New XmlDocument()
wsResponse = ws.TransactionAPI(transactionAPIParams)
doc.LoadXml(wsResponse)
Dim json As String = JsonConvert.SerializeXmlNode(doc)
'Dim response As New HttpResponseMessage(HttpStatusCode.OK)
Dim response As New StringContent(json, Encoding.UTF8, "application/json")
response = New StringContent(json, Encoding.UTF8, "application/json")
Return response.
Aucun commentaire:
Enregistrer un commentaire