i am confused around what type of object a request body should be. it seems at times it could be a String(in past experience), and at other times it could be IO-like(StringIO or similar). is there a consensus on what it should be between all adapters?
IO-like makes the most sense to me.
webmachine-test seems to assume it is a String(iirc).
You should always be able to call #each or #to_s on a request.body
i guess that means Enumerable(#each) or IO(#to_s) then.
I have looked into this to some extent recently, and the body should be nil or respond to at least one of #each, #to_s, and #call.
Most adapters have their own RequestBody class, if they have one you get #each and #to_s.
And with request.has_body? you can check if you have a request.body: https://github.com/seancribbs/webmachine-ruby/blob/master/lib/webmachine/request.rb#L52
#has_body? seems to be a bit off. With the streaming encoders as a body you don't neccessarily know the length, and none of them even responds to #empty?.
This is about request.body, not response.body.
Ooops. Forget all I said then.
alright, thanks all!