RequestError: The `body`, `json` and `form` options are mutually exclusive
See original GitHub issuehallo, thanks for this project.
i use it to translate chinese to english, a exception happen when the translate content is big.
The exception is:
Error: RequestError: The body
, json
and form
options are mutually exclusive
Error: The body
, json
and form
options are mutually exclusive
The translate content is:
我们用sureness
来管理restful api
认证鉴权
面对
restful api
的认证鉴权,基于rbac
(用户-角色-资源)主要关注于对restful api
的安全保护
无特定框架依赖(本质就是过滤器处拦截判断,已有springboot,quarkus,javalin,ktor
等demo)
支持动态修改权限配置(动态修改哪些api需要被认证,可以被谁访问)
支持主流http容器servlet
和jax-rs
支持多种认证策略,jwt, basic auth, digest auth
… 可扩展自定义支持的认证方式
基于改进的字典匹配树拥有的高性能 良好的扩展接口, demo和文档
sureness
的低配置,易扩展,不耦合其他框架,能使开发者对自己的项目多场景快速安全的进行保护
i guess the exception may happen in this code:
// If request URL is greater than 2048 characters, use POST method.
if (url.length > 2048) {
delete data.q;
requestOptions = [
`${baseUrl}?${querystring.stringify(data)}`,
{
method: "POST",
form: true,
body: {
q: text
}
}
];
}
```
the post method access google api may be can not use form when body is json.
Hope to help!
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Why this "The `body`, `json` and `form` options are mutually ...
RequestError: The body , json and form options are mutually exclusive. but for some reason the main promise doesn't throw... It's a double...
Read more >The `body`, `json` and `form` options are mutually ... - Issuehunt
How to make POST call with JSON body . Im getting RequestError: The `body`, `json` and `form` options are mutually exclusive #1222.
Read more >Node JS request-promises POST method doesn't recognize a ...
POST data to a JSON REST API ... Set option.body to your data and json: true to encode the body as JSON. var...
Read more >got - SurgBook
json Type: `boolean` Default: `false` *This is mutually exclusive with stream mode.* Parse response body with `JSON.parse` and set `accept` header to ...
Read more >Renovate Bot Package Diff
+ throw new TypeError('The `body`, `json` and `form` options are mutually exclusive');. 266. + }. 267. + if (isBody &&. 268. + !is_1.default....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In line 71: https://github.com/iamtraction/google-translate-api/blob/b15b464fb0a8fa4d58bc90d3d251250a8a71e907/src/index.js#L71
Just change from:
To:
And then it should work
This is my code. Would you let me know what is wrong, please?