Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 756041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:11:59+00:00 2026-05-14T15:11:59+00:00

I need my program to send a request to a server. The problem is,

  • 0

I need my program to send a request to a server. The problem is, the server only recognizes ös,äs und üs, but JAVA and/or Android don’t know them. `How can I send a request with a String like “Hermann-Löns” without JAVA/Android “changing” the ö…. Oh and btw., “oe” isn’t recognized by the server too, already tried that…

thx for help!

@BalausC:

I changed your code to:

I’m not sure if this is how you refer to the right fields…

String url = "http://busspur02.aseag.de/bs.exe?SID=473A2&ScreenX=1440&ScreenY=900&CMD=CR&DatumT=30&DatumM=4&DatumJ=2010&AbfAnk=Abf&ZeitH=10&ZeitM=45&Intervall=60&Loeschen=%28N%29eue+Suche";
        String charset = "CP1252";
        List<NameValuePair> params = new ArrayList<NameValuePair>();
        params.add(new BasicNameValuePair("HTO", start_from));
        params.add(new BasicNameValuePair("HT1", destination));
        UrlEncodedFormEntity query = new UrlEncodedFormEntity(params, charset);

            HttpPost post = new HttpPost(url);
            post.setEntity(query);
            InputStream response = new DefaultHttpClient().execute(post).getContent();
            // Now do your thing with the facebook response.

I can’t compile because I get an error saying:

The method getContent() is undefined
for the type HttpResponse

If I delete getContent() is says:

Type mismatch: cannot convert from HttpResponse to InputStream

One more thing: I use htmlparser (http://htmlparser.sourceforge.net/) to parse the resulting website. How do I access the resulting html site to parse it? Because otherwise I would have to rewrite nearly all of my code to get the results..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T15:11:59+00:00Added an answer on May 14, 2026 at 3:11 pm

    To the point, you need to use java.net.URLEncoder with the appropriate character encoding to encode the special characters in request parameters.

    String param = URLEncoder.encode("Hermann-Löns", "CP1252");
    

    Ensure that you specify an Accept-Charset: CP1252 header in the HTTP request. For a more complete code example how to fire a HTTP request with correct encoding, check this answer which I posted a hour ago. It also covers a HttpClient example which is also included in Android.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need my program to work only with certain USB Flash drives (from a
I need to send GET Request method with the below headers . I am
I need to change how my C# application connects to a server to send
My current program need to use programatically create a XPathExpression instance to apply to
For testing purposes I need my ABAP program to wait for few seconds. How
I have a .NET program and a Borland Win32 program that need to pass
I need to write a program used internally where different users will have different
I need to create an installer program that will do install the following: ASP.Net
I need to use lists for my program and needed to decide if I
I need to run a native program and retrieve the output in an Adobe

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.