Link to home
Start Free TrialLog in
Avatar of Spike UK
Spike UKFlag for United Kingdom of Great Britain and Northern Ireland

asked on

How do I add custom content to a HttpWebRequest header in VB.Net

I currently have a HttpWebRequest wcustom header written in VB.net defined as:

Dim request As HttpWebRequest = CType(WebRequest.Create(url), HttpWebRequest)
            request.Method = "POST"
            request.Headers.Add("X-SessionID", sessionID)
            request.ContentType = "application/json; charset=utf-8"

Open in new window


I need to add in the content as below created using PHP/JS.

$options = array(
  'http' =>
  array (
    'method'        => 'POST',
    'header'        => 'X-SessionID: ' . $MY_SESSION_ID . "\r\n" .
                       'Content-Type: application/json',
    'content'       => json_encode($mylist1),
    'ignore_errors'  => true,
  )
);

Open in new window


How do I do this?
ASKER CERTIFIED SOLUTION
Avatar of Kimputer
Kimputer

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Spike UK

ASKER

Very clear- thanks