mouuff / mtranslate

A simple api for google translate
MIT License
286 stars 83 forks source link

use POST instead of GET request #3

Closed eadmaster closed 3 years ago

eadmaster commented 8 years ago

Hi, i've tried the python script and it is still working pretty well.

Is it possible to send POST requests to translate longer text?

see: https://github.com/soimort/translate-shell/issues/30 https://www.filosophy.org/post/36/crossdomain_post_requests_to_google_translate_v2/

Epigene commented 8 years ago

I have not tested this, but I hear that making a POST with custom headers may do the trick.

Pseudocode

response = RestClient::Request.execute(url: url, method: :post, verify_ssl: false, headers: {"X-HTTP-Method-Override" => "GET"})
mouuff commented 8 years ago

I checked, there is indeed a problem with large texts today, thanks for the report