misterstick
Programmer
i'm trying to create a browser using wininet 5.00.2919.6305 (msie 5.01 128-bit international).<br><br>i've managed to get the GET method to work properly.<br><br>however, with forms using the POST method HttpSendRequest seems not to be adding the form data to the request, resulting in a "field 1 blank" error message as the return.<br><br>a quick search of the net suggests this could be because the accepting page does a redirect, but the code returned by HttpQueryInfo HTTP_QUERY_STATUS_REQUEST is 200 and not 302.<br><br>so, two questions:<br><br>1. how do i make this work?<br>2. how does wininet handle redirect requests from asp pages?<br><br><code><br>lngInetC = InternetOpen(strAppTitle, INTERNET_OPEN_TYPE_PRECONFIG, vbNullString, vbNullString, (0&))<br>lngInetH = InternetConnect(lngInetC, strServerName, INTERNET_DEFAULT_HTTP_PORT, vbNullString, vbNullString, INTERNET_SERVICE_HTTP, 0, 0)<br>strCBuff = strFormData ' this is in & delimited name=value pairs<br>lngCBuff = Len(strCBuff)<br>lngInetR = HttpOpenRequest(lngInetH, strMethod, strRest, "HTTP/1.0", strFrom, 0, INTERNET_FLAG_RELOAD Or INTERNET_FLAG_KEEP_CONNECTION, 0)<br>' i also tried adding combinations of INTERNET_FLAG_FORMS_SUBMIT, INTERNET_FLAG_DONT_CACHE, INTERNET_FLAG_NO_AUTO_REDIRECT<br>Const cstrContent As String = "Content-Type: application/x- lngInetR, cstrContent, Len(cstrContent), HTTP_ADDREQ_FLAG_REPLACE Or HTTP_ADDREQ_FLAG_ADD<br>If HttpSendRequest(lngInetR, vbNullString, 0, strCBuff, lngCBuff) <> 0 Then<br> lngCSize = 2048<br> strCBuff = String$(2048, vbNullChar)<br> InternetReadFile lngInetR, strCBuff, lngCSize, lngCBuff<br> strCBuff = Left$(strCBuff, lngCBuff)<br>End If<br>InternetCloseHandle lngInetC<br></code><br>