C# Post JSON with Authentication Header
I have problem with post JSON with authentication/Authorization.. Below is my code.. opponent said that they didnt receive the header...and i have no idea why... ASCIIEncoding encoding = new ASCIIEncoding(); byte[] data = encoding.GetBytes(stringData); HttpWebRequest req = (HttpWebRequest)WebRequest.Create(serverURL); req.Method = "POST"; req.ContentType = "application/json"; req.ContentLength = data.Length; req.Headers.Add("Authentication", merchantID); req.Headers["Authentication"] = merchantID; Stream newStream = req.GetRequestStream(); newStream.Write(data, 0, data.Length); newStream.Close
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.