mardi 5 juin 2018

Add custom HTTP headers in C# program

This is currently what I have in regards to setting up a post request from C# but I don't know how to add a custom header. The website uses a header called "x-version: 1.0.11814"

request.Method = "POST";
request.ContentType = "application/json";
request.ContentLength = data.Length;

request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.62 Safari/537.36";           
request.Accept = "application/json";            
request.(I NEED CUSTOM HEADER HERE)

Any help appreciated as Im doing this for my A Level Computing course project.




Aucun commentaire:

Enregistrer un commentaire