why not use content-type in response header to auto set responseType in got? #1759
Unanswered
winterAndvelvet
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What would you like to discuss?
responseType
Type: string
Default: 'text'
Note: When using streams, this option is ignored.
The parsing method. Can be 'text', 'json' or 'buffer'.
The promise also has .text(), .json() and .buffer() methods which return another Got promise for the parsed body.
It's like setting the options to {responseType: 'json', resolveBodyOnly: true} but without affecting the main Got promise.
so,why not use content-type in response header to auto set responseType ?
Checklist
Beta Was this translation helpful? Give feedback.
All reactions