KrijnvdBurg / j-gw2-api

Automatically exported from code.google.com/p/j-gw2-api
0 stars 0 forks source link

getEvents() doesn't works #2

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Call getEvents with some argument, for example : 
allEvents = getEvents("1001", null, null);
2. Try to get information from the created JSON : 
System.out.println(allEvents.get("events"));
3. See the output : []

What is the expected output? What do you see instead?
More events.

The problem is in the call of :

return new jGW2API(new URL(jGW2API.Standard_URL + jGW2API.API_Version + 
"/events.json" + args)).getJSONObject();

value of jGW2API.API_Version is "/v1/" and "/events.json" add an other "/" Then 
the full address is : 

"https://api.guildwars2.com/v1//events.json?world_id=2310"

You just have to remove the "/" from "/event.json".

Please provide any additional information below.

Original issue reported on code.google.com by Giry.Geo...@gmail.com on 24 May 2013 at 2:11

GoogleCodeExporter commented 8 years ago
This is strange, because yesterday I made an Event viewer which also uses this 
particular static function to grab events. It worked fine for me. I will 
investigate this once I am done making this whole thing in a more proper way 
(currently I find it hard to find names for certain classes: 
"SingleCertificateSSLSocketFactoryFactory" is kinda long)

Original comment by Varonth87 on 24 May 2013 at 5:21

GoogleCodeExporter commented 8 years ago
Should work now with the overhauled version.

This one is much more mature, has a better exception handling (you might have 
to handle some of your own now), and well included this bugfix.

The jGW2API class can be used pretty much in the same way as before, but it is 
much faster at generating new instances (after the first one), and allows for 
direct access to the HTTP data.

Original comment by Varonth87 on 24 May 2013 at 5:56

GoogleCodeExporter commented 8 years ago
Handling exceptions this way is really much better ! 

Thanks for the fix.

Original comment by Giry.Geo...@gmail.com on 24 May 2013 at 6:54