Text Translator

פרמיום
על ידי DEVISTY | מְעוּדכָּן hace un mes | Translation
פּוֹפּוּלָרִיוּת

9.9 / 10

חֶבִיוֹן

586ms

רמת שירות

100%

Health Check

100%

חזרה לכל הדיונים

Http Translation

Rapid account: Imaxeman 69
imaxeman69
hace un año

Trying to build an HTTP request. This is the url I’m building:
url = ‘https://text-translator2.p.rapidapi.com/+
translate?source_language=en&target_language=es&+
text=’ + http_urlencode(%trim(textIn));

Trying to build this on an IBM I using RPG.

Rapid account: Imaxeman 69
imaxeman69 Commented hace un año

I believe I have it working. Thank you.

Rapid account: Imaxeman 69
imaxeman69 Commented hace un año

I realize that you’re probably not versed in RPG on the IBM I. But this type of thing works all the time. Could you just confirm that the URL contains the source_language, target_language and the text to be converted? The documentation on RAPIDAPI.COM is not very concise.

url = ‘https://text-translator2.p.rapidapi.com/+
translate?source_language=en&target_language=es&+
text=’ + http_urlencode(textIn);

       http_xproc( HTTP_POINT_ADDL_HEADER
         : %paddr(headers) );

      http_req('POST':
                url:
                *omit:
                jsonOut:
                *omit:
                *omit:
                'application/x-www-form-urlencoded');    
									
									The error I'm getting back is that the source_language is required. 
Rapid account: Imaxeman 69
imaxeman69 Commented hace un año

It would be. The program I’m using to make the call is doing a Post.

Rapid account: Dickyagustin
dickyagustin Commented hace un año

I’m sorry, but the endpoint ‘/translate’ only supports the POST method

הצטרף לדיון - הוסף תגובה למטה:

התחבר / הירשם כדי לפרסם תגובות חדשות