Curl error 1101 (unable to get a response...)

Hi! I tried to find a solution for the error 1101 in the forum, but nothing works. Can anyone please help me? I tried different things, but really I don’t know what can I do. The error shows “unable to get a response with the specified url: http://translations:”
Also I used curl-to-blocks. This is the code I’d like to use:

HTTP

EXAMPLE REQUEST

POST /v2/translate?auth_key=my api key> HTTP/1.0
Host: api-free.deepl.com
User-Agent: YourApp
Accept: /
Content-Length: [length]
Content-Type: application/x-www-form-urlencoded

auth_key=my api key&text=Hello, world&target_lang=DE

EXAMPLE RESPONSE

{
“translations”: [{
“detected_source_language”:“EN”,
“text”:“Hallo, Welt!”
}]
}


Or this:

cURL

EXAMPLE REQUEST

curl https://api-free.deepl.com/v2/translate
-d auth_key=my api key
-d “text=Hello, world!”
-d “target_lang=DE”

EXAMPLE RESPONSE

{
“translations”: [{
“detected_source_language”:“EN”,
“text”:“Hallo, Welt!”
}]
}

Thanks in advanced :blush:

Try this way

Once you get response use dictionary blocks to get specific data from json

Sorry, I don’t know how do that :sweat:. Do I need to use this blocks to get the translation “English - German” from the url?:
image
I’ve never used json or dictionaries.

Using [Free] Json To Dictionary Extension and above response example

{
	"translations": [{
		"detected_source_language":"EN",
		"text":"Hallo, Welt!"
	}]
}

It still doesn’t work. I did exactly like your blocks, but the response it’s empty:

Try this site,to convert curl to blocks.

Thanks, but I did it. Theses blocks are the result of the getaix.

If there’s a post text then no need of get again.

You are using both post andd get together

2 Likes

Finally I did it! Thanks everyone for your help. I found in other thread how to do it easier. There is two ways (differents blocks, but they do the same thing) to use deepL API translator:


image
Of course, get your API free in deepL to use this excelent translator :blush:

By the way, you can add “source language” before translating to your blocks:
blocks (4)
I figured it out and it worked :grinning:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.