> Also, I think OPTIONS should be removed from the list of methods that enforce a Content-Length. I wouldn’t normally expect any payload for OPTIONS, since RFC 7231 explicitly says it does not define a use for a payload, but requires a Content-Type if a payload is sent.
I think Martin's right about this and it's consistent with my concern about servers treating the existence of a Content-Length header as an indicator of a request body.
In any event, with the new logic, a Content-Length header will be added if the body is not None.
> I've just put the logic inside _set_content_length
Fair enough. It /does/ encapsulate all logic around setting the content length within the method.
I've left a couple minor comments in Rietveld. In addition to what's there, docs should also be updated to reflect the new behaviour.
Thanks for the work on this!