Closed russcam closed 4 years ago
Not overly keen on the fn name read_body_as_text()
but named it in line with the existing read_body
. I am considering breaking here and renaming them simply to text()
and json()
, respectively, which would mirror reqwest.
I agree, I like text()
and json()
better. Would we change read_body()
if we went with text()
and json()
?
Would we change read_body() if we went with text() and json()?
Yeah, I was thinking
read_body
would become json
read_body_as_text
would become text
Oh haha, duh 🙃
Yeah, I vote for that.
Merged this in and opened #74 for the renaming breaking change
Labelled this also a breaking change as the default response format for cat APIs is now plain text
This commit updates the api_generator to set text/plain content-type and accept headers by default for all cat APIs.
It also introduces a read_body_as_text async fn on Response to be able to treat the response body as plain text
Closes #71