Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems using cfhttp on google translation services.

Status
Not open for further replies.

CJWilson3759

Programmer
Mar 3, 2004
3
US
I've been trying to cfhttp the google translation service using this url
Copy n' paste above url (instead of clicking link) into browser and it translates flawlessly.


I wrote the code at bottom of page below. Everytime I run it I get the returned error below:

"Forbidden
Your client does not have permission to get URL /translate_c?hl=en&ie=UTF-8&oe=UTF-8&langpair=en%7Cit&u= from this server."

Does anyone know how to get around this and return the translated page instead?

The code I wrote is below"

<cfparam name="l" default="it">
<cfparam name="u" default="<cfset translateurl="
<!--- <cfhttp url=" method="get"></cfhttp> --->

<cfhttp url="#translateurl#" method="post">
<cfhttpparam type="FORMFIELD" name="hl" value="en">
<cfhttpparam type="FORMFIELD" name="ie" value="#URLEncodedFormat('UTF-8')#">
<cfhttpparam type="FORMFIELD" name="oe" value="#URLEncodedFormat('UTF-8')#">
<cfhttpparam type="FORMFIELD" name="langpair" value="en%7Cit">
<cfhttpparam type="FORMFIELD" name="u" value="#URLEncodedFormat(u)#">
</cfhttp>

<cfoutput>#cfhttp.fileContent#</cfoutput>
 
try this FAQ, see if it helps.

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top