Sending xml in HTTP post

Sorry im new to VB, i have this code fragment which posts to a url and then prints out the responce. Assuming i had some xml in the form of a string, how would i fire it at the this address? would it be a parameter of req.send?

Private Sub Command1_Click()

Dim req As New MSXML2.XMLHTTP30

req.Open "POST", "", False
' Set the HTTP Headers
req.setRequestHeader "HOST", "localhost"
req.setRequestHeader "Content-Type", "multipart/form-data"


Dim responseStr As String
responseStr = "Content-Type: " & req.getResponseHeader("Content-Type") & vbCrLf
responseStr = responseStr & "Content-Length: " & req.getResponseHeader("Content-Length") & vbCrLf
responseStr = responseStr & req.responseText & vbCrLf & req.responseBody & vbCrLf & req.statusText
Debug.Print responseStr

End Sub
Who is Participating?
mladenoviczConnect With a Mentor Commented:
req.send YourXMLString
Ryan ChongCommented:
I think that points should be splitted
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.