Author: richierich112582 | Posted on: 7/21/2009 11:10:02 AM | Views : 788

Hello all,


Has anyone had an issue with sending a POST HTTPWebRequest and not having an Authorization Header being added to it.  I manually add it before I POST with this code.


request.Headers["Authorization"] = "Basic " + Convert.ToBase64String(new UTF8Encoding().GetBytes("username" + ":" + "password"));


The server I'm trying to post too returns a 401 because the Authorization header never gets added to POST nor PUT but for some reason it does with GETs and everything works fine there.


Here is my POST
POST /accounts/1/apps/1/dev-msgs HTTP/1.1
Content-Type: application/xml
Host: myHost
Content-Length: 197
Expect: 100-continue
*****No Authorization header above**********

Here is my GET
GET /accounts/1/apps/1 HTTP/1.1
Content-Type: application/xml
Authorization: Basic cmljaGllcmljaDExMjU4MjoxM ...

Go to the complete details ...