• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HTTP POST problems

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have just written a program which translates a word from French to English using the Altavista Babelfish translation website http://babelfish.altavista.com/babelfish/tr

I stole the essential piece of code from the web which sends the text to translate -




next I read the translation with -



It works sometimes but at other times, the web server sends back

Error 157 Error decoding translated text

. Is there a way to capture all the information sent when I click the translate button? Is there a better way?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

Is there a way to capture all the information sent when I click the translate button?


Check out the LiveHTTPHeaders extension for Firefox.

As to the error, I am guessing that the URL is not properly encoded, because "frenchWord" contains some characters that shouldn't occur in an URL. Try "java.net.URLEncoder.encode(frenchWord, "UTF-8")" instead.
 
Any sufficiently advanced technology will be used as a cat toy. And this tiny ad contains a very small cat:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic