46,180 questions
Need help in sending xml file to azure-api.net using vb6.0
Bill dim
21
Reputation points
I am a student and I am trying to send an xml file to azure-api.net
Can someone please help met, telling me what I should send through the parameter queryString$ in the following function?
Private Function PostRequest(queryString$, userid$, key$, body$) As String
With New WinHttpRequest
.Open "POST", "https://data.azure-api.net/Senddata?" & queryString, True
.SetRequestHeader "userid", userid
.SetRequestHeader "Key", key
.SetRequestHeader "Content-Type", "application/json"
.Send body '<- UTF8-conversion of the body-string happens automatically
If Not .WaitForResponse(10) Then '<- give it 10 seconds timeout
Debug.Print "http-request timed out..:"
ElseIf .Status <> 200 Then
Debug.Print "http-request failed with status: "; .Status & " " & .StatusText
Else 'success (let's return the string-response)
PostRequest = .ResponseText 'again, conversion from UTF8 is automatic
End If
End With
End Function
Community Center Not monitored
Sign in to answer