I’ve used the sample parameters for summarize-text, but I get the error in the title:
var options = {
method: ‘POST’,
url: ‘https://text-analysis12.p.rapidapi.com/summarize-text/api/v1.1’,
headers: {
‘content-type’: ‘application/json’,
‘x-rapidapi-host’: ‘text-analysis12.p.rapidapi.com’,
‘x-rapidapi-key’: ‘…’
},
data: {
language: ‘english’,
summary_percent: 10,
text: 'I believe that it is fundamental to have an overview of the history the…"
ディスカッションに参加しましょう-以下にコメントを追加してください:
Use Array first and then convert it into json like below:
$post_fields = array (
‘language’ => ‘english’,
‘text’ => validated[′inputtext′]);post_fields = json_encode($post_fields);
It works for me.
I can also send you the postman snapshot if you like.
I understood the issue. Your body type is set to “Body type: x_www_form_urlencoded” this is incorrect.
Summarize text endpoint consumes JSON body.
I have no idea about how Integromat works but you need to pass JSON contents in the body.
Your headers must also contain “content-type”: “application/json”
Everything works in the RapidAPI console.
But in the environment I’m using (HTTP 'Make a request module in Integromat)
These are the screenshots from the module. This may be outside of your expertise, but still Integromat is very popular… do you have any ideas on why this error is happening…?
The (Long String) is the sample text, copied and pasted from the summarize-text code snippet.
and
Could you describe your problem in more detail?
And also provide the source code.
Did you get this error while trying out in the RapidAPI console?
If yes simply refresh your browser and try again.
If you got this error while using nodejs or any other language/framework.
Prefer to use Postman’s auto-code generation (RapidAPI’s auto-code generation doesn’t
always work correctly)
If you have any more queries please feel free to ask them.
(But please create a new comment instead of replying here so
that I get notified. RapidAPI only notifies me of root comments)