danielcrenna/hammock — Issue #46: Entity serializer is unable to change the request headers
Author: MarkKharitonov
Created: 2011-10-16 16:17:18+00:00
State: open

HTTP headers are part of the HTTP payload, hence it is reasonable to allow an entity serializer the read/write access to the current request headers. Right now two problems prevent this:

1. The `ISerializable` interface does not provide the current request object to the implementation.
1. The `RestClient.SetQueryMeta` first populates the query headers and only then serializes the entity.

The first problem is overcome quite easily - a serializer instance can be passed the current request object in the serializer constructor. This means a new serializer object is created per request.

It is the second problem that must be resolved, because even if the serializer does change the request headers, these changes do not propagate to the query object - it is too late, the query headers are already populated.