In my GAE, I have the following segment of code:
accountId := r.Header.Get("user_id")
if accountId == "" {
accountId = r.FormValue("user_id")
if accountId == "" {
utility.CreateErrorResponse(w, "User ID is missing from request")
return
}
}
the code basically try to read "user_id" from Header but the accountId is empty making the program to return early unexpected.
Here is my C# client code:
...
HttpWebRequest req = (HttpWebRequest) WebRequest.Create(data);
req.Method = "GET";
req.KeepAlive = false;
foreach (ExtraAttribute att in mAttributes)
{
req.Headers.Add( att.mKey, att.mValue);
}
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
...
where the foreach help me add the "user_id" attribute to the Request Header. (And I have confirmed the existence of "user_id" entry in Fiddler)
What is the next thing I should do to find out whats going on?
Thanks
I just found that after i changed the attribute name from "user_id" to "UserId" and everything works now...
Don't know if its the capital case or the underscore problem.