Need help in sending xml file to azure-api.net using vb6.0

Bill dim 21 Reputation points
2021-12-17T15:44:46.497+00:00

Can someone please tell me, what should be the contents of 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

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,447 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MikeUrnun 9,777 Reputation points Moderator
    2021-12-17T21:09:22.517+00:00

    Hello @Bill dim - Since your question concerns an implementation in VB 6.0 (for constructing a request containing XML data to APIM), it may be better to post this question on the VB 6 Community channels: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/visual-basic-6.0-documentation#vb6-community-resources

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.