Home » Tag Archives: JSON

Tag Archives: JSON

How To Return Error Details From REST APIs

json-logo

The HTTP protocol uses status codes to return error information. This facility, while extremely useful, is too limited for many use cases. So how do we return more detailed information? There are basically two approaches we can take:         Use a dedicated media type that contains the error details Include the error details in the used media ...

Read More »

REST API with JSON

json-logo

What is REST API? REST stands for Representational State Transfer. It relies on a stateless, client-server, cacheable communications. In most cases it is used with the HTTP protocol. RESTful applications use HTTP requests to POST (create), PUT (create and/or update), GET (e.g., make queries), and DELETE data. REST uses HTTP for all four CRUD (Create/Read/Update/Delete) operations.       What ...

Read More »

Converting JSON to XML to Java Objects using XStream

json-logo

XStream library can be an effective tool for converting JSON to Java to XML translations to and fro. Lets explore each one of them one by one, and see which driver is used. Handling JSONs To convert JSON to Java objects all you have to do is initialize XStream object with an appropriate driver and you are ready to serialise ...

Read More »

Jersey/Jax RS: Streaming JSON

json-logo

About a year ago I wrote a blog post showing how to stream a HTTP response using Jersey/Jax RS and I recently wanted to do the same thing but this time using JSON. A common pattern is to take our Java object and get a JSON string representation of that but that isn’t the most efficient use of memory because ...

Read More »

Using Google GSON : Extra Goodies : Part I

json-logo

Introduction This is follow-up article to previous Getting Started with Google GSON where it shows the introductory material on using the Google Gson. This article shows some extra goodies of GSON library. As there are lot of things to write about these extra goodies, so i splitted long article into 2 article series, So, this part one of it and ...

Read More »

Using Google GSON : Extra Goodies : Part II

json-logo

We continue with Using GSON from last article, also in case you missed the first article in series here is link. So, here we go with another installment in series. Versioning Support If you want to maintain multiple versions of an object for JSON conversion, Google GSON library has nice @Since annotation for it. This annotation can be applied to ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close