Get the Desktop App for Battle.net Now
- All your games in 1 place
- Log in once
- Automatic game updates
You can grab someone's career profile with /api/d3/profile/btag-id/ but if you omit the trailing forward slash the request fails.
However, if you want to access a certain hero for that user by doing /api/d3/profile/btag-id/hero/id it works but if you add the trailing forward slash it fails.
It's not a big deal but it seems like something you guys should make consistent on your end.
Edited by viscrom#1983 on 8/31/2012 1:50 PM PDT
It seems anything that returns multiple items, such as a profile (multiple heros) or follows can have a trailing slash.
Think of it as a directory with files in it. Your profile is a directory, each hero is a file. Same goes for artisans and followers
You would think you can go to /api/d3/data/item/ and get a list of ALL items in the game, but alas, it doesn't work, and I doubt it ever will. It would be a rather expensive call
Oh, I see what your are saying now. The slash is REQUIRED and probably shouldn't be. I misunderstood your concern.
I agree the slash shouldn't be required.
What I have noticed is that it maps to the "index" file. these both go to the same place
The same thing is true about your profile page
He's referring to this API specifically.. not saying it holds true for every directory everywhere
Correct. Also they are using Tomcat, htaccess files are ignored on that server.
I did a little research and it seems mixed (just as I suspected). Some popular APIs use the trailing / on resources that return 1 or more results and others do not.
Twitter for example doesn't seem to use trailing slashes on anything according to their docs:
Threats of violence. We take these seriously and will alert the proper authorities.
Posts containing personal information about other players. This includes physical addresses, e-mail addresses, phone numbers, and inappropriate photos and/or videos.
Harassing or discriminatory language. This will not be tolerated.