Try to parse all requests as json and fallback to returning text if unparsable. In case the body is unparsable but content-type is json we throw an error. Also add tests for various cases.
Created a new file for request because I didn't want to add all the new test cases in api_test.mjs file. That file is already quite large.
Fixes #53
Try to parse all requests as json and fallback to returning text if unparsable. In case the body is unparsable but content-type is json we throw an error. Also add tests for various cases.
Created a new file for
request
because I didn't want to add all the new test cases inapi_test.mjs
file. That file is already quite large.