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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:44:31+00:00 2026-05-26T02:44:31+00:00

I have a MVC 3 Web Sevice being hosted on an Amazon EC2 Instance.

  • 0

I have a MVC 3 Web Sevice being hosted on an Amazon EC2 Instance. I have an android app that is making a post request to the service. However a 400 bad request is returned saying that the header name is invalid. I checked the logs on the server and the request does not make it into IIS. The HTTP Err Log just has these entries:

2011-10-07 02:01:05 xxx.xxx.xx.xx xxxxx xx.xxx.xx.xx 80 HTTP/1.1 POST /API/UserAccount/Login 400 – Header –

Not really sure what is going on. I tested this web service on the developement server that comes with visual studio and there was no problems. Here is the code that creates the post request on Android:

HttpPost post = new HttpPost(LOGIN_URL);
StringEntity se = new StringEntity(json);
se.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE,
    "application/json"));
post.setEntity(se);
response = client.execute(post);

Any insight is appreciated.

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-26T02:44:31+00:00Added an answer on May 26, 2026 at 2:44 am

    Change the way you’re setting the Http headers. Here’s an updated version of your code:

    HttpPost post = new HttpPost(LOGIN_URL);
    StringEntity se = new StringEntity(json);
    se.setContentEncoding("UTF-8");
    se.setContentType("application/json");
    post.setEntity(se);
    response = client.execute(post);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an MVC 3 web app that calls a SOAP web service to
I have an object which contains models for my ASP.NET MVC web app. The
Background I have a page on my ASP.NET MVC web app for users to
Im trying to develop my first ASP.NET MVC web app and have run into
I have an asp.net mvc 2 web application that connects to a WCF web
I have an ASP.NET MVC site that contains a WCF SVC that is hosted
I'm stumped. I've got an asp.net mvc app being hosted on a shared hosting
I have a pretty big webapp that's being built in MVC. I'm also abstracting
I am building a web app built on Spring MVC and Hibernate. I have
I have built a Spring 3 MVC driven RESTful web service app. I use

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.