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 7692947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:58:13+00:00 2026-05-31T20:58:13+00:00

I need to send a http post request from my android device to a

  • 0

I need to send a http post request from my android device to a web server that is running on my localhost:8080 and is being hosted by the google app engine.

the current code is this:

    try {

                HttpPost httppost = new HttpPost("http://192.168.2.220:8080");
                httppost.setHeader("Content-type", "application/json");
                ResponseHandler <String> responseHandler = new BasicResponseHandler();
                StringEntity se = new StringEntity(object.toString()); 
           se.setContentEncoding(newBasicHeader(HTTP.CONTENT_TYPE,"application/json"));
                httppost.setEntity(se);
                System.out.println("Request Sent");
                String response = httpclient.execute(httppost, responseHandler);

                String temp = EntityUtils.toString(response.getEntity());



            } catch (ClientProtocolException e) {}
            catch (IOException e) {
            }
        }

I also tried setting:

    HttpPost httppost = new HttpPost("http://10.0.2.2:8080");

In all cases, the response is null and the program force closes. am i sending the request correctly? can anyone please guide me here?

Thanks

  • 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-31T20:58:15+00:00Added an answer on May 31, 2026 at 8:58 pm

    ‘Send a request to localhost’ means to send it to the local machine. In your case that would be the Android device. You want to send the request to your desktop machine, which is a remote host. The problem is that the Appengine dev_sever by default only binds to the local address, so it can’t be accessed remotely (i.e., from your Android device). You need to pass the --address option to make accessible from the outside. Check your computer’s IP and pass it as the address. Something like:

    dev_appserver.cmd --address=192.168.2.220
    

    Details here: http://code.google.com/appengine/docs/java/tools/devserver.html

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

Sidebar

Related Questions

I need to send data via http protocol (GET or POST request) from the
I need to send a HTTP request (and get XML response) from Flash that
There is a process that will send an http post request to a specific
I need to make a nodejs client application that can send a POST request
I need send certain attributes(say, human readable user name) from server to client after
I need my program to send a request to a server. The problem is,
Possible Duplicate: How secure is a HTTP POST? I need to send sensitive information
I want to send a couple of values to a web server from my
I need to use HTTP Post to send a a string array like so...
I'm sending an HTTP POST request from my C++ app to a PHP script

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.