Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request : lastModified parameter in GetGuild/GetCharacter #22

Closed
Dongorath opened this issue Jul 19, 2011 · 4 comments
Closed
Assignees

Comments

@Dongorath
Copy link

Blizzard puts a limit on requests made by day to the API and encourage "good behavior" by allowing more queries. The main "good behavior" cited is the use of Last-Modified header in the requests (source : WoW Forums - Community Platform API - Applications, rate limits and throttling ).

This Last-Modified information is present in the base Guild et Character objects (LastModified property stored as long in Guild and string in Character (I suspect them to be a javascript date object)) and thus can be stored by the application using this API.
It would be useful to be able to pass this parameter to the GetGuild and GetCharacter functions.

I think this request can be done only after doing issue #13 ("Need better exception handling").

@briandek
Copy link
Owner

briandek commented Aug 7, 2011

I'm looking at this and how to best approach it.

More blue post related info: http://us.battle.net/wow/en/forum/topic/2966897246

@ghost ghost assigned briandek Aug 30, 2011
@ghost
Copy link

ghost commented Sep 7, 2011

I have some thoughts on implementing the "If-Modified-Since" request header in this API.

The method that makes the actual request is WowDotNetAPI.Utilities.JsonUtility.FromJson(string url, string publicAuthKey, string privateAuthKey). My thought is to add a fourth parameter of type long called "lastModified", where the lastModified value from any previous request could be passed. If no value is passed (because the specific call doesn't support it or you want to force fresh data), the value could be -1. Otherwise pass the relevant value.

Then, in the method, we check said value and if it is greater than 0, the http header is included in the request.

I might play around with this in my local copy of the API to see if/how it would work and get some tests behind it before I think about committing the changes. Any thoughts/suggestions would be appreciated. :)

@briandek
Copy link
Owner

briandek commented Sep 7, 2011

I think blizzard was going to add a value like that to their resources:
#38 (comment)

Your suggestion sounds pretty good though. Should be interesting to see what you can come up with.

I saw your post in the forum (I can't post since I don't have an active Wow account anymore) and I still work on this from time to time. I've been meaning to clean up the models and make it easier to interact with some of the base models, etc.

If you see anything that you feel could be improved or that you could contribute with, please feel free to jump in :D

@ghost
Copy link

ghost commented Sep 7, 2011

Hey man. I was looking at the lastModified/if-modified-since situation, and I think what needs to happen with this library first is the proper handling of response codes. If the "if-modified-since" header is sent, and there is nothing that has been modified, it sends back a 304 response instead of a 200 response with data, which isn't being handled.

I do have some ideas, but I'm working on some smaller issues with my application (such as the login/registration/profile stuff) for my guild's website before I start tackling that. Some good ideas have been raised, such as having all calls return a standard object with response code/error/etc, as well as the requested object should there be valid data. I'm leaning towards that, but again, I haven't really gotten my hands dirty. I'll keep you informed.

Good to know the project is still active. It is by far the easiest to use and most stable .NET API I've seen so far, so I'm throwing my lot in with it. ;)

@briandek briandek closed this as completed Dec 3, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants