• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

URLConnection 422 Http Error response

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:



java.io.IOException: Server returned HTTP response code: 422 for URL:

at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown So
urce)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unkn
own Source)

 
Sheriff
Posts: 22784
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
422 means "http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#4xx_Client_Error" (source: http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#4xx_Client_Error). Unfortunately, that's as far as I can help you as I've never seen this status code appear "in the wild" before.
 
Mano Krrish
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.....!!!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic