Skip to content
This repository has been archived by the owner on Sep 4, 2019. It is now read-only.

ServerNotify #9

Open
kfn opened this issue Oct 4, 2013 · 1 comment
Open

ServerNotify #9

kfn opened this issue Oct 4, 2013 · 1 comment

Comments

@kfn
Copy link

kfn commented Oct 4, 2013

In the method sendAlert() I think the header is wrong:
HttpWReq.Headers.Add("ContentType", "text/plain");

I think it should be
HttpWReq.Headers.Add("Content-Type", "text/plain");

I get an error on my bb device when receiving a push message:
Missing Content-type header for push

EDIT. I receive an error after changing ContentType to Content-Type:
Error: System.ArgumentException: The 'Content-Type' header must be modified using the appropriate property or method.
Parameter name: name
at System.Net.WebHeaderCollection.ThrowOnRestrictedHeader(String headerName)
at System.Net.WebHeaderCollection.Add(String name, String value)

@jmutter
Copy link
Contributor

jmutter commented Oct 4, 2013

kfn, Thanks for the catch. After looking at it, perhaps the best way is to simply use the ContentType property of the HttpWebRequest class.

HttpWReq.ContentType = "text/plain";

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants