I am working on an app for the Blackberry. I would like to use their dynamic licensing scheme. They require a response to a request that contains a license key. Their documentation is as follows:
The vendor portal expects the following response:
HTTP/1.1 200 OK
Content-Type: application/www-url-encoded
Content-Length: 20
key=ABCDEFGHIJK
Looking at the above, I intended to do something like:
String hkeystr = "somekindofkey";
sb.AppendFormat("Content-Length: {0}\r\n", hkeystr);
sb.AppendFormat("{0}={1}", "key", hkeystr);
//now post back the key.
Response.ContentType = "application/www-url-encoded";
Response.Write(Server.UrlEncode(sb.ToString()));
What I'm not sure about is the Content-Length part of this. Content-Length is a standard HTTP header, but the response class does not have it as a member. It has Content type, but not ContentLength. Is what I did above correct, or am I to assume that
the Response class will automatically include the Content-Length as part of the Response.Write?
Member
2 Points
23 Posts
Http Response Content Length
Nov 10, 2009 09:33 PM|Robotuner|LINK
Hi:
I am working on an app for the Blackberry. I would like to use their dynamic licensing scheme. They require a response to a request that contains a license key. Their documentation is as follows:
The request is as follows:
POST /pathfromdeveloper HTTP/1.1
Content-Type: application/www-url-encoded
Content-Length: 120
Host: hostfromdeveloper
PIN=12341234&email=customeremail@email.com&product=product&version=1.2&transactionid=123&test=false
The vendor portal expects the following response:
HTTP/1.1 200 OK
Content-Type: application/www-url-encoded
Content-Length: 20
key=ABCDEFGHIJK
Looking at the above, I intended to do something like:
String hkeystr = "somekindofkey";
sb.AppendFormat("Content-Length: {0}\r\n", hkeystr);
sb.AppendFormat("{0}={1}", "key", hkeystr);
//now post back the key.
Response.ContentType = "application/www-url-encoded";
Response.Write(Server.UrlEncode(sb.ToString()));
What I'm not sure about is the Content-Length part of this. Content-Length is a standard HTTP header, but the response class does not have it as a member. It has Content type, but not ContentLength. Is what I did above correct, or am I to assume that the Response class will automatically include the Content-Length as part of the Response.Write?
Thanks
Http Response BlackBerry Dynamic Licensing