Jump to content
YOUR-AD-HERE
HOSTING
TOOLS

Locked Send GET or POST


C.Oy

Recommended Posts

Imports:

 

Imports System.Net

 

 

Variables:

 

Dim req As HttpWebRequest

Dim res As HttpWebResponse

Dim con As New CookieContainer

 

 

Function GET:

 

Function sendGet(ByVal url As String) As String

req = CType(httpWebRequest.Create(url), HttpWebRequest)

req.UserAgent = "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0"

req.Keepalive = True

req.ContentType = "application/json"

req.CookieContainer = con

req.Method = "GET"

res = CType(req.GetResponse, HttpWebResponse)

Dim reader As New IO.StreamReader(res.GetResponseStream)

Dim out As String = reader.ReadToEnd

' TextBox1.Text = out

End Function

 

Function POST Data:

 

Function sendPost(ByVal url As String, ByVal data As String) As String

req = CType(HttpWebRequest.Create(url), HttpWebRequest)

req.UserAgent = "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0"

req.KeepAlive = True

req.ContentType = "application/json"

req.CookieContainer = con

req.Method = "POST"

Dim barray() As Byte = System.Text.Encoding.UTF8.GetBytes(data)

req.ContentLength = barray.Length

Dim dstream As IO.Stream = req.GetRequestStream

dstream.Write(barray, 0, barray.Length)

res = CType(req.GetResponse, HttpWebResponse)

Dim reader As New IO.StreamReader(res.GetResponseStream)

Dim out As String = reader.ReadToEnd

'TextBox2.Text = out

End Function

 

Usage Example GET: pubOut = sendGet("https://www.classy.org/checkout/donation?eid=49420")

Usage Example POST: sendPost("https://www.wepayapi.com/api/messenger", """client_id"":""166684"",""user_name"":""Bruno Souza"",""email"":""[email protected]"",""cc_number"":""4984532261122893"",""cvv"":""233"",""expiration_month"":""04"",""expiration_year"":2018,""address"":{""address1"":""Rua do Brazil"",""city"":""Pien"",""country"":""BR"",""postcode"":""83860000""},""device_token"":""62cfd89e-4514-40e7-852a-a669c31d27c2""")

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.