Advertisement
Guest User

Untitled

a guest
Jul 12th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.85 KB | None | 0 0
  1.         Dim webClient As New WebClient()
  2.         Dim resByte As Byte()
  3.         Dim resString As String
  4.         Dim reqString() As Byte
  5.  
  6.         Dim urltopost As String = "https://bcpimmo.net/api/immos"
  7.  
  8.         Try
  9.  
  10.  
  11.             webClient.Headers.Add("Authorization", " 2b0c2011-b5f1-44b1-88ea-29fc4522ec5e")
  12.             webClient.Headers.Add("content-type", "application/json")
  13.  
  14.             reqString = Encoding.Default.GetBytes(JsonConvert.SerializeObject(Label1.Text, Formatting.Indented))
  15.             resByte = webClient.UploadData(urlToPost, "post", reqString)
  16.             resString = Encoding.Default.GetString(resByte)
  17.             Console.WriteLine(resString)
  18.  
  19.             MsgBox(resString)
  20.  
  21.             webClient.Dispose()
  22.  
  23.         Catch ex As Exception
  24.             Console.WriteLine(ex.Message)
  25.             MsgBox(ex.Message)
  26.         End Try
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement