I’m currently using an HTTPSSocket for posting and getting some data from a website. The first thing I have to do is log in to the site. In the HTTPSSocket, I set up a dictionary with my username and passwords. I then send that dictionary to the HTTPSSocket.SetFormData method. URLConnection has no such method for whatever reason.
I have tried to figure out what that method actually creates so I can do it manually myself, but looking at the socket in the debugger, I can't actually find out what the SetFormData method does. Here’s what I send with the HTTPSSocket:
Dim d As New Dictionary d.Value("Email") = somevalue d.Value("Password") = someothervalue HTTPsSock.SetFormData(d) Dim gcurl As String = kgcURLStart+"api/account/login" HTTPsSock.Post(gcurl)
In URLConnection I only have the SetRequestContent method. I’m assuming I would do something like this in that method:
Dim LoginText as string = “Email=somevalue&Password=someothervalue MyURLConnection.SetRequestContent(LoginText, ??????) MyURLConnection.Send(“POST”, kgcURLStart+"api/account/login”)
The question marks, ????? in the SetRequestContent line are because I have no idea of the Mime Type to be used here. None of the documentation for either socket talks about that.
What would I use?