Open fnmunhoz opened 3 years ago
ETags
Most successful results will contain an “etag” attribute and ETag HTTP header with a digest of the returned content. In order to save bandwidth and make your application more performant, you may optionally pass an “if-none-match” HTTP header with that digest for subsequent requests to the same URL. If the content has not changed since the last request, the response code will return with an empty body and a 304/Not Modified HTTP header and you can use a previously-stored value for the content.
Note: Most browsers will do this automatically, but you may need to manually add this logic to server-side applications.
GZIP Compression
In order to save bandwidth and make your application more performant, the Marvel Comics API can compress responses with GZIP. You may request a GZIP-ed response by passing an Accept-Encoding header to any endpoint.
From: https://developer.marvel.com/documentation/attribution
On this page we'll discuss some specific rules of the road that you'll need to follow when accessing and displaying data from the Marvel Comics API on your web site or application. These rules of the road basically boil down to:
Understand your rate limit.
Attribute Marvel as the source when displaying API data.
Link to Marvel when you display large images.
Authentication for Server-Side Applications
Server-side applications must pass two parameters in addition to the apikey parameter:
ts - a timestamp (or other long string which can change on a request-by-request basis)
hash - a md5 digest of the ts parameter, your private key and your public key (e.g. md5(ts+privateKey+publicKey) For example, a user with a public key of “1234” and a private key of “abcd” could construct a valid call as follows: http://gateway.marvel.com/v1/comics/?ts=1&apikey=1234&hash=ffd275c5130566a2916217b101f26150 (the hash value is the md5 digest of 1abcd1234)
Marvel API https://developer.marvel.com/docs
General info: https://developer.marvel.com/documentation/generalinfo