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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:49:00+00:00 2026-05-28T14:49:00+00:00

This is the script that works: curl -H ‘content-type:application/json’ -d ‘{userrequest: {username: testname, status:

  • 0

This is the script that works:

curl -H  'content-type:application/json' -d '{"userrequest": {"username": "testname", "status": 1}}'  http://http://employeestracking.appspot.com/clockin.add_clockin

This is what I tried to use in android:
further,How can I see/debug the output?

                    HttpParams httpParams = new BasicHttpParams();
                HttpClient client = new DefaultHttpClient(httpParams);
                HttpPost httpost = new HttpPost("http://employeestracking.appspot.com/clockin.add_clockin");
                httpost.setHeader("Accept", "application/json");
                httpost.setHeader("Content-type", "application/json");
                System.out.println("2");
                JSONObject data = new JSONObject();
                JSONObject userrequest = new JSONObject();
                HttpResponse response = null;
                try {
                    userrequest.put("username","TestDemo");
                    userrequest.put("status",1);
                    data.put("userrequest", userrequest);
                    System.out.println(data);
                    httpost.getParams().setParameter("data",data);
                    try {
                        response = client.execute(httpost);
                        System.out.println(response);
                    } catch (ClientProtocolException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    } catch (IOException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }

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

this is what i get from the server:

41.132.228.221 - - [26/Jan/2012:01:18:29 -0800] "POST /clockin.add_clockin HTTP/1.1" 400 663 - "curl/7.19.7 (i486-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15"

41.132.228.221 – – [26/Jan/2012:01:18:55 -0800] “POST /clockin.add_clockin HTTP/1.1” 200 151 – “curl/7.19.7 (i486-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15”
0.1.0.1 – – [26/Jan/2012:01:31:52 -0800] “GET /tasks/train HTTP/1.1” 404 124 – “AppEngine-Google; (+http://code.google.com/appengine)”
41.132.228.221 – – [26/Jan/2012:01:37:17 -0800] “POST /clockin.add_clockin HTTP/1.1” 500 663 – –

  • 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-28T14:49:01+00:00Added an answer on May 28, 2026 at 2:49 pm

    I replaced

    httpost.getParams().setParameter("data",data);
    

    with:

    StringEntity se = new StringEntity(data.toString());
    httpost.setEntity(se);
    

    and it worked

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

Sidebar

Related Questions

I have this RewriteRule that works too well :-) RewriteRule ^([^/]*)/$ /script.html?id=$1 [L] The
Well basically I have this script that takes a long time to execute and
I have this script that collects data from users and I want to check
I have a Python script that is running a few ls commands. This script
I'm trying to write a python script that packages our software. This script needs
I want to execute this script (view source) that uses Google Translate AJAX API
This is a crude korn shell script that someone else wrote. I don't know
I have a script that looks like this #!/bin/bash function something() { echo hello
I have this line in a useful Bash script that I haven't managed to
I've got a bash script that reads input from a file like this: while

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.