Something went wrong. Try again later

cuthbeorht

This user has not updated recently.

2 0 0 1
Forum Posts Wiki Points Following Followers

cuthbeorht's forum posts

Avatar image for cuthbeorht
cuthbeorht

2

Forum Posts

0

Wiki Points

1

Followers

Reviews: 0

User Lists: 0

Giantbomb suggests that you use a custom User Agent in the header or else the Api thinks you're a bot.

ie.

User-Agent: "My Awesome App"

Avatar image for cuthbeorht
cuthbeorht

2

Forum Posts

0

Wiki Points

1

Followers

Reviews: 0

User Lists: 0

#2  Edited By cuthbeorht

Hi @rayo329,

JSON is a portable format in a way that any language with an appropriate parser can serialize/deserialize it to/from objects; Java is no different.

Regarding Java specifically, you're going to have to choose a framework that does this for you (You could do it manually, but that's plain tedious ;) ). I can recommend Spring Boot since it is pretty easy to get started with. Spring Boot = Consume REST Api is a good place to start.

To answer your question specifically, you need to create POJO's (Data Transfer Objects - DTO's in this case) that maps to the JSON. The way I go about it is I take an example response and create my classes that way.

I hope this helps you get started.