Sorry, wrong forum. Reposted in 
https://groups.google.com/forum/#!topic/google-translate-api/vFfr7lhWz1M

On Sunday, April 7, 2013 2:34:04 AM UTC+13, Andrew Beaven wrote:
>
> Hi there,
>
> I'm trying to call the Google Translate API using ajax like so:
>
> var Utils = {
>>     translate: function(message, callback) {
>>         $.ajax({
>>             type: 'POST',
>>             url: 'https://www.googleapis.com/language/translate/v2',
>>             headers: { "X-HTTP-Method-Override": "GET" },
>>             dataType: 'jsonp',
>>             data: {
>>                 key: '<my key here>',
>>                 source: 'en',
>>                 target: 'ru',
>>                 q: message
>>             },
>>             success: callback
>>         });
>>     }
>> }
>
>
> I'm finding that when the message is too large, I get a 414 error, 
> indicating that the request URL is too large - it looks like the message 
> is concatenated onto the request URL. I'm confused by this because I had 
> thought that data sent in POST ajax requests were not sent via parameters 
> in the URL. The translate docs mention if you want to sent lots of data, to 
> do so via a POST, so I thought I'd be fine
>
> Is there anything I'm doing wrong here?
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Google AJAX APIs" group.
To post to this group, send email to
google-ajax-search-api@googlegroups.com
To unsubscribe from this group, send email to
google-ajax-search-api+unsubscr...@googlegroups.com
To view this message on the web, visit
https://groups.google.com/d/msg/google-ajax-search-api/-/XfBD35OP1m4J
For more options, visit this group at
http://groups.google.com/group/google-ajax-search-api?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"Google AJAX APIs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-ajax-search-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to