Meaningless Drivel is fun!
The moose likes Java in General and the fly likes URLConnection 422 Http Error response Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "URLConnection 422 Http Error response" Watch "URLConnection 422 Http Error response" New topic

URLConnection 422 Http Error response

Mano Krrish

Joined: Sep 10, 2010
Posts: 13
Hi all,

I have a JSON feed which I am trying to call using URLConnection. I requested the feed with authentication parameters(UserName & Password) and got the cookies of the call, then tried to request the server with cookies, for the feed data, but I received a 422 Http Error response. Could any one please help us on this and correct me if I am wrong in any other aspect of using the Connection too.

Thanks in advance!!

I have given below the error console and the code snippet I am using for this: Server returned HTTP response code: 422 for URL:

at So
own Source)

Rob Spoor

Joined: Oct 27, 2005
Posts: 19908

422 means "" (source: Unfortunately, that's as far as I can help you as I've never seen this status code appear "in the wild" before.

How To Ask Questions How To Answer Questions
Mano Krrish

Joined: Sep 10, 2010
Posts: 13
Thanks for the reply Rob,

Yep, the definition of the 422 Error response is much weird, which I couldn't figure out. May be could you please confirm if the code I am using is correct?
Mano Krrish

Joined: Sep 10, 2010
Posts: 13
All I just need to get currently is the reader of that inputstream, but I am getting this exception only just before the getInputStream() during the runtime.

Please help me.....!!!
I agree. Here's the link:
subject: URLConnection 422 Http Error response