I was asked to write some code to interface with the Wi-Flight Api in visual basic. I already have code to login and interface with the API.
I am writing some sample code to submit a reservation. To do this, I have created an XML file using an XmlTextWriter. I now need to submit the data to Wi-Flight servers by sending the data in a PUT request like este.
I have looked around to try and find a way to send the data through a WebRequest and the best I go is este but I don't seem to understand how to get it working.
preguntado el 05 de mayo de 13 a las 15:05
Prueba el siguiente código:
Using wc As New System.Net.WebClient() wc.UploadFile("SERVER_URI", "PUT", "PATH_TO_XML_FILE") End Using
If you haven't the XML file saved, you could put a String content in a similar way:
Using wc As New System.Net.WebClient() wc.UploadString("SERVER_URI", "PUT", XML_Content) End Using