I need to use the Google Translate API in my Laravel application, get requests are working fine, but post requests don't seem to, I tried with Postman and got the same error message.
Here's the test I made:
Route::get('/', function () {
return Http::withHeaders([
"content-type" => "application/x-www-form-urlencoded",
"accept-encoding"=> "application/gzip",
"x-rapidapi-key"=> "<rapid_api_key_here>",
"x-rapidapi-host"=> "google-translate1.p.rapidapi.com",
"useQueryString"=> true
])->post('https://google-translate1.p.rapidapi.com/language/translate/v2/detect', [
"q"=> "English is hard, but detectably so",
]);
});
Here's the error I got in both tests:
I don't know what went wrong, any suggestions?