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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:59:49+00:00 2026-05-18T08:59:49+00:00

I am trying to send data from android to Django app. I want to

  • 0

I am trying to send data from android to Django app. I want to store the data in a table in sqlite database called “mytable”. Here is the android code:

    try {
        ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
        HttpClient httpclient = new DefaultHttpClient();
        HttpPost httppost = new HttpPost("http://localhost:8000/androidweb/edit/");
        JSONObject j = new JSONObject();
        try {
            j.put("name", "david");
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        nameValuePairs.add(new BasicNameValuePair("year", j.toString()));
        httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
    //  myTextView.setText(j.toString());
        HttpResponse response = httpclient.execute(httppost);
        myTextView.setText(response.getStatusLine().toString());
    //  myTextView.setText(response.toString());
    }catch(Exception e) {
        myTextView.setText("Error in http connection "+e.toString());
}

The issue is resolved now. I only needed to have a return value

  • 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-18T08:59:50+00:00Added an answer on May 18, 2026 at 8:59 am

    Sounds like Django’s Cross-Site Request Forgery framework, which by default prevents third-party POST requests. Read Django’s CSRF docs for details.

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

Sidebar

Related Questions

I am trying to send data from an Android app to a PHP file
I'm trying to send data from my Android app to my PC over TCP.
I want to be a able to securely send data from my Android App
I am currently trying to send some data from and Android application to a
I want to send data to server from client(Android), below is my format http://101.34.45.45/rawData?data={userId:guest1,timestamp:2010-07-01
I am trying to output POST-data that I send from an android phone, however
i'm trying to send an http request from an Android app to a Java
Im trying to send multiple data items over a tcp socket from an android
I'm trying to send and receive binary data sms from my app (sdk 2.1-update
I'm trying to send data from an AJAX call to database tables that are

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.