CJWilson3759
Programmer
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>
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>