This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes http response code 400 in httpurlconnection's getinputstream Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "http response code 400 in httpurlconnection Watch "http response code 400 in httpurlconnection New topic
Author

http response code 400 in httpurlconnection's getinputstream

mark goking
Ranch Hand

Joined: Aug 18, 2009
Posts: 155
hi. im baffled why the con.getInputstream() returns an http response code of 400. here is the code


any ideas? thanks


Website/Java Games: http://www.chitgoks.com
Tech Blog: http://tech.chitgoks.com
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8915
    
    8

A HTTP 400 error code is a "Bad Request". Can you reach the site with a browser? I see you are attempting to upload some data. Is there a service on the server side that can receive data?


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
mark goking
Ranch Hand

Joined: Aug 18, 2009
Posts: 155
yes. actually it works if the file is small. the problem arises when the file's big
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8915
    
    8

What size file breaks it? Is there a limitation on the server?
mark goking
Ranch Hand

Joined: Aug 18, 2009
Posts: 155
hey joe i will let you know. my friend who did the server side module modified the code to accept an xml with base64 rather than sending the inputstream byte array when http posting
 
GeeCON Prague 2014
 
subject: http response code 400 in httpurlconnection's getinputstream