1

I have a standard java http client. I am receiving a JSON response while invoking an HTTP operation.

The response looks like as below :

//OK[25,24,23,22,21,20,19,8,8,8,8,8,18,17,16,15,14,8,13,12,11,10,9,9,8,8,8,7,4,6,5,4,3,2,34,1,["[Ljava.lang.String;/2600011424","17501-20000-39010","1152963","Not Available","Open","2222","01/15/2012","0.00","1663.07","02/09/2012","02/15/2012","4446.36","2783.29","2038.71","02407.65","03/11/2012","486.76","07135.7900","0","01/26/2012","001122 AAA BBB CCC","1","Y","01/23/2012","E"],0,5]

Though the content type is application/json in the response, I am not sure on how to process this JSON format.

Any help is appreciated.

6
  • But the HTTP response header Content-Type says application/json; charset=utf-8 Commented Jan 27, 2012 at 10:23
  • 3
    @user1173245 — The server lies. Commented Jan 27, 2012 at 10:24
  • If you can strip the non-JSON parts from that response you might then try to parse the remaining JSON using one of the many parsing frameworks like gson, json-simple etc. Commented Jan 27, 2012 at 10:25
  • This one looks GWT RPC not JSON Commented Jan 27, 2012 at 10:25
  • @user1173245 If I was the server I could also tell you the content type is application/msword :) Commented Jan 27, 2012 at 10:28

2 Answers 2

2

Check JSON in Java. Should be pretty easy to use.

Sign up to request clarification or add additional context in comments.

Comments

0

That isn't actually JSON, but if you strip off the //OK from the front then it would be.

Strip through characters then run it through a JSON parser. Several are listed just after the diagrams on the JSON homage.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.