Closed wboayue closed 12 years ago
Can you send me a raw post using application/json? I mean headers and body and all.
I will implement it within minutes.
On Apr 17, 2012, at 7:46 AM, Wil Boayue wrote:
When a POST request is submitted to the silkjs sever, the request is properly decoded if the content-type is
multipart/form-data
orapplication/x-www-form-urlencoded
. Data from other content types is discarded.Data from an unknown content type could be put in
req.data.post
.When using models in Ext JS 4 with the rest proxy, data is posted as
application/json
. There is no way to access this data in the request object.
Reply to this email directly or view it on GitHub: https://github.com/mschwartz/SilkJS/issues/21
OK, I found a WWW page that talks about application/json posts. req.data.post makes sense. Should it be automatically JSON decoded or the string?
On Apr 17, 2012, at 7:46 AM, Wil Boayue wrote:
When a POST request is submitted to the silkjs sever, the request is properly decoded if the content-type is
multipart/form-data
orapplication/x-www-form-urlencoded
. Data from other content types is discarded.Data from an unknown content type could be put in
req.data.post
.When using models in Ext JS 4 with the rest proxy, data is posted as
application/json
. There is no way to access this data in the request object.
Reply to this email directly or view it on GitHub: https://github.com/mschwartz/SilkJS/issues/21
I pushed the change. See if it works for you. The string is stored in req.data.post.
On Apr 17, 2012, at 7:46 AM, Wil Boayue wrote:
When a POST request is submitted to the silkjs sever, the request is properly decoded if the content-type is
multipart/form-data
orapplication/x-www-form-urlencoded
. Data from other content types is discarded.Data from an unknown content type could be put in
req.data.post
.When using models in Ext JS 4 with the rest proxy, data is posted as
application/json
. There is no way to access this data in the request object.
Reply to this email directly or view it on GitHub: https://github.com/mschwartz/SilkJS/issues/21
That works. Is the exact patch I made locally. Thanks.
The issue has reappeared, because of an extra line of code (httpd/request.js, line 143) :
142: } 143: req.data = data; 144: 145: return true;
It overrides the post variable, stored at line 139 ( req.data.post = post; ). I commented out the line 143, and it works again.
Actually, would be better to write :
else { if( typeof(data) == undefined ) { var data = new Object(); } req.data = data; req.data.post = post; }
instead of
else { req.data.post = post; }
(and still leave commented previously line 143)
Feel free to offer pull requests.
Thanks!
When a POST request is submitted to the silkjs sever, the request is properly decoded if the content-type is
multipart/form-data
orapplication/x-www-form-urlencoded
. Data from other content types is discarded.Data from an unknown content type could be put in
req.data.post
.When using models in Ext JS 4 with the rest proxy, data is posted as
application/json
. There is no way to access this data in the request object.