Skip to content

Commit

Permalink
fix request body for POST method
Browse files Browse the repository at this point in the history
option should be an object, rather a string.
  • Loading branch information
jqlu committed Dec 6, 2018
1 parent ea5d0fa commit 56314ca
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,11 @@ async function translate(text, options) {
`${url}?${querystring.stringify(data)}`,
{
method: 'POST',
body: {
body: JSON.stringify({
q: text
}
})
}
];
requestOptions[1] = JSON.stringify(requestOptions[1]);
}
else {
requestOptions = [ url ];
Expand Down

0 comments on commit 56314ca

Please sign in to comment.