On Aug 23, 2011, at 2:28 PM, Bill Burke wrote:
>>>
>>> I also think there are a lot of problems with it:
>>>
>>> * How do you set the Content-Type of a Target? What I'm getting at is, what's the point of having Target implement the
>>> SyncInvoker interface?
>>
>> Content type SHOULD be included when entity is not empty, but it is not a mandatory header. You can include it via:
>> client.target(...).type("text/plain").put(entity);
>>
>> Or you can just omit it (not recommended):
>> client.target(...).put(entity); // content type defaults to "application/octet-stream"
>>
>> Other option would be to add an extra parameter for content-type into the invoker methods that consume entity (PUT, POST
>> ...). But we discussed this with Santiago and we feel that the extra parameter would make the method signatures somewhat
>> complex.
>>
>> Yet another option would be to provide some default content type resolution support for most common entity types.
>>
>
> All this just so that you don't have to invoke a request() method (which is fluent-compliant BTW) on Target. IMO, which I've stated in the past, a request() method makes a clear separation of concerns.
+1. I like the explicit transition provided by a request() method on Target.
-- Santiago