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

  • SEARCH
  • Home
  • 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

Ask A Question

Stats

  • Questions 447k
  • Answers 447k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The solution I settled on was using notifier chains. On… May 15, 2026 at 7:35 pm
  • Editorial Team
    Editorial Team added an answer Within your string XPathQuery I think you need to quote… May 15, 2026 at 7:35 pm
  • Editorial Team
    Editorial Team added an answer MAC operations are limited to machines directly connected within your… May 15, 2026 at 7:35 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.