Google Translate

फ्रीमियम
द्वारा Google Cloud | अपडेट किया गया 5 महीने पहले | Text Analysis
लोकप्रियता

9.9 / 10

लेटेंसी

438ms

सेवा का स्तर

91%

सभी चर्चाओं पर वापस जाएं

Having a 400 error status using google translate and axios (post method)

avatar
kizito917
2 वर्ष पहले

I am trying to post a word to get its translated version but i keep getting a 400 error and when i try same code here on test endpoint button, it works perfectly, what might be the reason for the 400 error

avatar
googlecloud commented 2 वर्ष पहले

Hey kizito917, it looks like there’s an issue with how the axios code snippet is being generated. If you alter that snippet to send the data as URL encoded parameters as expected, it will work through axios! https://share.getcloudapp.com/WnuGXryo I’ll reach out to RapidAPI to investigate why this is happening.

avatar
jamesabrannan commented 2 वर्ष पहले

Not working. Receiving this in postman, where obviously I xxxx out my key. In fact, none of the endpoints are working as of 11:42 EST.

GET https://google-translate1.p.rapidapi.com/language/translate/v2/languages?target=en
Error: incorrect header check
Warning: This request did not get sent completely and might not have all the required system headers
Request Headers
X-RapidAPI-Host: google-translate1.p.rapidapi.com
X-RapidAPI-Key: xxxxxxxxxxx
User-Agent: PostmanRuntime/7.24.1
Accept: /
Cache-Control: no-cache
Postman-Token: 90b5775a-a5fb-468e-8abd-b6e89a4c00d7
Host: google-translate1.p.rapidapi.com
Accept-Encoding: gzip, deflate, br
Connection: keep-alive

avatar
kizito917 commented 2 वर्ष पहले

I was able to fix the issue using request

var request = require(‘request’);

use this to make request to the API , axios has some issues with making request to this API

चर्चा में शामिल हों - नीचे टिप्पणी जोड़ें:

नई टिप्पणियाँ पोस्ट करने के लिए लॉग इन / साइनअप करें
रेटिंग: 3.8 - वोट: 18