Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Question about Web requests..

Hey guys, I had a few questions about web requests. I'm not completely sure to what their capabilities are. I actually have no clue, I was just wondering how would I implement them to get rid of browsers, they're quite annoying. Pretty much just wondering these things:

What all can they do?
When are they appropriate to be used.
How to implement them in place of a browser.
and now you know why everyone suggest a person to actually learn the language rather than just "fucking around" with it.
I was simply asking a question as I'm learning it. No need to be so hostile. I was asking a simple question about it, as the Book I'm using skimps on that part. :\
(Jun 23, 2011 07:42 PM)Xaros Wrote:  I was simply asking a question as I'm learning it. No need to be so hostile. I was asking a simple question about it, as the Book I'm using skimps on that part. :\

sry man,... you kmow how it is... 90% off everyone here, is all... "C&P., .OMG it dont work" so forgive me if i mis-read you.

gimme till tomarrow, and i will double check ur thread, and have another look at it.
what are your web browsers doing?
[Image: Yucwo7j.png]

I'm looking at browsers. I'm looking at using web requests to replace web browsers..
(Jun 23, 2011 10:28 PM)Xaros Wrote:  I'm looking at browsers. I'm looking at using web requests to replace web browsers..

what do you mean you are looking at browsers, i am asking what does your browser, which you want to replace. currently do?
[Image: Yucwo7j.png]

Ah, I'm not trying to currently make something in particular. I meant I'm NOT looking at browsers, sorry. I'm just looking at how they're used to fill in information on a certain webpage. such as user, and pass etc. You understand what I'm trying to say, right?
yeah, the best thing to do imo is use tamperdata on firefox to find out how the data is getting "POST"ed ot "GET"ed then use this function to post or get it
PHP Code

<?php 
Function WRequest(URL As String, method As String, POSTdata As String)
  
Dim responseData As String = ""
  
Try
    
Dim request As Net.HttpWebRequest = Net.WebRequest.Create(URL)
    
request.Accept = "*/*"
    
request.AllowAutoRedirect = true
    request
.UserAgent = "http_requester/0.1"
    
request.Timeout = 60000
    request
.Method = method
    
If request.Method = "POST" Then
  request
.ContentType = "application/x-www-form-urlencoded"
  
Dim encoding As New ASCIIEncoding()
  
Dim postByteArray() As Byte = encoding.GetBytes(POSTdata)
  
request.ContentLength = postByteArray.Length
  Dim postStream 
As IO.Stream = request.GetRequestStream()
  
postStream.Write(postByteArray, 0, postByteArray.Length)
  
postStream.Close()
    
End If
    
Dim response As Net.HttpWebResponse = request.GetResponse()
    If 
response.StatusCode = Net.HttpStatusCode.OK Then
  Dim responseStream 
As IO.StreamReader = _
  
New IO.StreamReader(response.GetResponseStream())
  
responseData = responseStream.ReadToEnd()
    
End If
    
response.Close()
    Catch 
e As Exception
  responseData 
= "An error occurred: " & e.Message
  End 
Try
  
WRequest = responseData
End 
Function 

and call it like this

PHP Code

<?php 
WRequest
("http://server/login", "POST", "name=jane&stat=active") 

or
PHP Code

<?php 
WRequest
("http://server/", "GET", "") 

so this could be an example for pw and email

PHP Code

<?php 
WRequest
("http://www.website.com/", "POST", "email=" & email & "&password=" & password) 
[Image: Yucwo7j.png]



Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by evilgnomeJan 11, 2022 05:39 AM 2 195 Jan 11, 2022 05:39 AM
Last Post: Charger
[Python] by 05317832892Dec 28, 2018 07:33 AM 2 113 Dec 28, 2018 07:33 AM
Last Post: 05317832892
[C#] by Y3LI0NZMar 7, 2017 10:01 AM 2 159 Mar 7, 2017 10:01 AM
Last Post: Ninja