vb.net - How to make get request like this -
here code , ses single line
directcast(webrequest.create("http://example.com/xxx.htm"), httpwebrequest)
is there way add http://example.com
, add request line of code sub page /subpage rather adding full url address
something postreq.method = "get /page"
dim postdata string = "" dim tempcookies new cookiecontainer dim encoding new utf8encoding dim bytedata byte() = encoding.getbytes(postdata) dim postreq httpwebrequest = directcast(webrequest.create("http://example.com/xxx.htm"), httpwebrequest) postreq.method = "get" postreq.keepalive = true postreq.accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" postreq.headers.add("accept-language:en-us,en;q=0.8,en-us;q=0.5,en;q=0.3") postreq.headers.add("accept-encoding:gzip,deflate") postreq.headers.add("accept-charset:windows-1251,utf-8;q=0.7,*;q=0.7") postreq.headers.add("keep-alive:115") postreq.useragent = textbox2.text 'postreq.proxy = new webproxy(listbox1.text, true) postreq.contentlength = bytedata.length ' dim postreqstream stream = postreq.getrequeststream() ' postreqstream.write(bytedata, 0, bytedata.length) on error resume next ' postreqstream.close() dim postresponse httpwebresponse postresponse = directcast(postreq.getresponse(), httpwebresponse) tempcookies.add(postresponse.cookies) 'logincookie = tempcookies dim postreqreader new streamreader(postresponse.getresponsestream()) dim thepage string = postreqreader.readtoend textbox1.text = textbox1.text & thepage
Comments
Post a Comment