Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim webClient As New WebClient()
- Dim resByte As Byte()
- Dim resString As String
- Dim reqString() As Byte
- Dim urltopost As String = "https://bcpimmo.net/api/immos"
- Try
- webClient.Headers.Add("Authorization", " 2b0c2011-b5f1-44b1-88ea-29fc4522ec5e")
- webClient.Headers.Add("content-type", "application/json")
- reqString = Encoding.Default.GetBytes(JsonConvert.SerializeObject(Label1.Text, Formatting.Indented))
- resByte = webClient.UploadData(urlToPost, "post", reqString)
- resString = Encoding.Default.GetString(resByte)
- Console.WriteLine(resString)
- MsgBox(resString)
- webClient.Dispose()
- Catch ex As Exception
- Console.WriteLine(ex.Message)
- MsgBox(ex.Message)
- End Try
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement