http - ServiceStack HEAD request ContentLength not getting set -


i using servicestack (4.0.31) mono , using raw streaming, means dto of form:

[fallbackroute("/{path*}")] public class s3request  : irequiresrequeststream{      public string path{ get; set; }     public stream requeststream { get; set; } } 

i implement http request types: get, head, post, put, delete. need head respond defined in rfc 2616 says:

"the head method identical except server must not return message-body in response. metainformation contained in http headers in response head request should identical information sent in response request."

this should simple within servicestack, has proven difficult given understanding far. example, if try following, gives me want (for head request response):

response.endrequestwithnocontent(); 

however not work because zeroes out content-length header field, not consistent rfc (and client). if not make call, when return servicestack iresponse after having set content-length, default xml in output, not consistent rfc. also, can't decorate dto or set default route not return xml because must use irequiresrequeststream common route.

can use response filter or else tell servicestack head response , not fill in xml, not remove content-length?

you can end request without resetting content-length just:

response.endrequest(); 

Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -