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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:30:01+00:00 2026-05-27T12:30:01+00:00

I have a web address www.abc.com/check … I have created a web service on

  • 0

I have a web address http://www.abc.com/check … I have created a web service on this address for receiving data. Through an android app i send some data to this address using following code:

public class TestappActivity extends Activity {
    EditText ch;
    Button btn;
    InputStream is;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        ch=(EditText)findViewById(R.id.ch);
        btn=(Button)findViewById(R.id.btn);

        btn.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View arg0) {
            sendData();

            }
        });


    }


    private void sendData() {

          Log.i(getClass().getSimpleName(), "send  task - start");

            HttpParams p=new BasicHttpParams();
            p.setParameter("name", ch.getText());


          HttpClient client = new DefaultHttpClient(p);


          try {
                HttpResponse response=client.execute(new HttpPost("http://www.abc.com/check"));
                is=response.getEntity().getContent();

        } catch (ClientProtocolException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
        } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
        }



          Log.i(getClass().getSimpleName(), "send  task - end");

        }
}

How can i find if my post was successful ? What do i get back when i post something. ?

  • 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-27T12:30:01+00:00Added an answer on May 27, 2026 at 12:30 pm

    [update]Simple solution, you can just check the status code

    response.getStatusLine().getStatusCode();  
    

    It’s a integer(200 means OK, 500 means error on server) , Reference Here

    Or a completely check by using the response body

    response.getEntity().getContent();
    

    It is generated on the server by your service, so if you want to assure the invocation is really successful, you can return something to client. e.g. a XML string

    "<status>OK</status>" 
    

    in the response body would be enough. You will get it on client and then do whatever you want to do.

    I recommend the simpler solution. Thanks shraddha

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

Sidebar

Related Questions

I have an web address: http://www.example.com/org/companyA I want to be able to pass CompanyA
I created a simple WCF web service(following this tutorial: http://blogs.msdn.com/b/ericwhite/archive/2010/05/11/getting-started-building-a-wcf-web-service.aspx ), because I don't
I have web service which return json string like : d={main0ID:abc.es/main,main1ID:ah/main} I wanna append
I have created an orchard cms blog with a url like www.testurl.com I would
I have a problem in ISAPI_rewrite 3. a have a url like www.example.com/web/index.html?ag=2154 What
I have a site on this address http://www.kela.nu and in the Google result it
I have a WCF web service which throws exceptions when invalid data is submitted.
I have a dedicated Linux web server where my website is running like www.example.com.
I have a block of text which occasionally has a really long word/web address
I have been asked to implement some email address validation on a web app

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.