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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:05:21+00:00 2026-05-24T19:05:21+00:00

My problem is that I have successfully login to my Rail sever with HTTP

  • 0

My problem is that I have successfully login to my Rail sever with HTTP Post.

And I also get the response object, toString the Entity.

response =  httpclient.execute(post);
r_entity = response.getEntity();
String responseString = EntityUtils.toString(r_entity);
Log.d("UPLOAD_MAIL_LOGIN", responseString);

Successfully got the login html code.(which means I have logged in.)

However, when I start to POST something through this client(just after I logined),

my Log just show that I have logout already. The sever has rendered me back to the login page.
(The strange part is that I just get that page’s html code to insure I’m still in login status)

HttpGet get_new = new HttpGet("http://myseverblabla.heroku.com/clips/new");
response =  httpclient.execute(get_new);
HttpEntity n_entity = response.getEntity();
String responseString = EntityUtils.toString(n_entity);
Log.d("UPLOAD_MAIL_NEW_MSG", responseString);           
This part worked very well.



HttpPost post_send = new HttpPost("http://vocal-clp.heroku.com/clips/");

MultipartEntity multipartEntity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);
multipartEntity.addPart("clip[receiver_id]", new StringBody(phoneNumber.getText().toString()));
...
...
...

multipartEntity.addPart("clip", new FileBody(recodeFile));  
//This is an audio file.
post_send.setEntity(multipartEntity);           
response = httpclient.execute(post_send);
HttpEntity s_entity = response.getEntity();
responseString_s = EntityUtils.toString(s_entity);
Log.d("UPLOAD_MAIL_SEND", responseString_s);   

This UPLOAD_MAIL_SEND Log show that I just back to the login page.

My problem is :

1.Is there any limitation about httpclient, like you can’t post something directly?
2.I have tried another sever, which doesn’t has account system, it worked fine. The file and text is uploaded.


I’m sure that I typed the object[content] entity well(Checked and compared by reading two severs rails log)

These question has bothered me for many days, hope someone can help me with it.

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-24T19:05:21+00:00Added an answer on May 24, 2026 at 7:05 pm

    How do you configure your HttpClient and where does it come from?

    If it’s an AndroidHttpClient then it doesn’t retain cookies by default, which would cause the session to be lost, see the doc for the solution : http://developer.android.com/reference/android/net/http/AndroidHttpClient.html and let me know…

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

Sidebar

Related Questions

I was trying to login to a site remotely. I have successfully done that
I have encountered a problem that I have not come accross yet when setting
We have the problem that we have the open project files in our SVN
I have a problem that I have not faced before: It seems that the
i have bought a template that have built in contact form problem is that
I have been Googling a problem that I have with trying to integrate the
This is a really weird problem that I have been having. When I download
I often run into the problem that I have one stream full of data
I frequently run into the problem that I have to preserve state between several
Here is a hum-dinger of a problem that I have not found an answer

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.