We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Response<string>
Response<string> returned rather than a json response.
...
Should return a response with a json() method, like in the repo readme example.
json()
{ "name": "test", "version": "1.0.0", "description": "", "exports": "./index.js", "type": "module", "scripts": { "start": "node --loader ts-node/esm ./src/index.ts" }, "author": "", "license": "ISC", "devDependencies": { "@types/got": "^9.6.12", "ts-loader": "^9.5.1", "ts-node": "^10.9.1", "typescript": "^5.3.2" }, "dependencies": { "got": "^14.0.0" } }
index.ts
import got from "got"; async function main() { const response = await got.post("https://httpbin.org/anything", { json: { hello: "world", }, }); console.log(response); console.log(response.json()); } main();
The text was updated successfully, but these errors were encountered:
https://www.npmjs.com/package/got-cjs import got from "got-cjs";
import got from "got-cjs";
Sorry, something went wrong.
@gitgrimbo you should specify responseType: "json" in options, see the docs.
responseType: "json"
No branches or pull requests
Describe the bug
Actual behavior
Response<string>
returned rather than a json response....
Expected behavior
Should return a response with a
json()
method, like in the repo readme example.Code to reproduce
index.ts
Checklist
The text was updated successfully, but these errors were encountered: