It is a PUT coming from Firefox.
Let me break down the situation. Firefox does a put
PUT
http://localhost:49927/Services/Security/SecurityArea/3Request Headers
Accept | application/json,application/javascript |
Accept-Encoding | gzip, deflate |
Accept-Language | en-us,en;q=0.5 |
Connection | keep-alive |
Content-Length | 255 |
Content-Type | application/json; charset=UTF-8 |
Cookie | ASP.NET_SessionId=f3hek53gi4awnx54ypaz434g; AuthToken=02339850-2843-4fb1-82b4-9b888596fad8 |
Host | localhost:49927 |
Referer | http://localhost:49927/PartTest.aspx |
Transaction | commit |
User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20100101 Firefox/10.0 |
X-Requested-With | XMLHttpRequest |
Sending the following in the Request body:
{"UtcCreated":"/Date(1327877500038-0600)/","UtcModified":"/Date(1327877500038-0600)/","UtcDisabled":null
,"CreatedBy":null,"ModifiedBy":null,"DisabledBy":null,"Id":3,"Name":"Test Security Area1","Description"
:null,"IsBaseLevel":false,"Parent":{"$ref":"4"}}
Now, that request fires the onPut method of my service. However, RequestContext.Get<IHttpRequest>().InputStream's length is 0.
This came about as I'm trying to access the #4 value of $ref, but was having issues figuring out how to make my DTO to grab it. But, now this has become a mission.
I just confirmed this same problem using Curl (saw the same behavior):
c:\>curl -H "Content-Type: application/json" -vX PUT
http://localhost:49927/Services/Security/SecurityArea/3 -d "{\"UtcCreated\":\"/Date(1327877500038-0600)/\",
\"UtcModified\":\"/Date(1327877500038-0600)/\",\"UtcDisabled\":null,\"CreatedBy\
":null,\"ModifiedBy\":null,\"DisabledBy\":null,\"Id\":3,\"Name\":\"Test Security
Area1\",\"Description\":null,\"IsBaseLevel\":false,\"Parent\":{\"$ref\":\"4\"}}
"
* About to connect() to localhost port 49927 (#0)
* connected
* Connected to localhost () port 49927 (#0)
> PUT /Services/Security/SecurityArea/3 HTTP/1.1
> User-Agent: curl/7.21.0 (amd64-pc-win32) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.
2.3
> Host: localhost:49927
> Accept: */*
> Content-Type: application/json
> Content-Length: 255
>
< HTTP/1.1 200 OK
< Server:
ASP.NET Development Server/
10.0.0.0< Date: Sun, 12 Feb 2012 04:03:47 GMT
< X-AspNet-Version: 4.0.30319
< Cache-Control: private
< Content-Length: 0
< Connection: Close
<
* Closing connection #0