Sample code for 30+ languages & platforms
VB.NET

Inspect HTTP Request Header

Demonstrates the LastHeader property.

Chilkat VB.NET Downloads

VB.NET
Dim success As Boolean = False

Dim http As New Chilkat.Http

Dim url As String = "https://chilkatsoft.com/echo_request_body.asp"
Dim json As String = "{""greeting"":""Hello World""}"

' Send a POST with the JSON in the HTTP request body.
Dim resp As New Chilkat.HttpResponse
success = http.HttpStr("POST",url,json,"utf-8","application/json",resp)
If (success = False) Then
    Debug.WriteLine(http.LastErrorText)
    Exit Sub
End If


' Examine the HTTP request header we just sent.
Debug.WriteLine(http.LastHeader)

' Output:

' POST /echo_request_body.asp HTTP/1.1
' Host: chilkatsoft.com
' Accept: */*
' Accept-Encoding: gzip
' Content-Type: application/json
' Content-Length: 26