Skip to content

Commit

Permalink
Refactor: All methods are GET requests
Browse files Browse the repository at this point in the history
  • Loading branch information
fvdm committed Oct 7, 2021
1 parent 2db9814 commit c380fbe
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions europeana.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ module.exports = class Europeana {

async search (parameters) {
return this._talk ({
method: 'GET',
url: 'https://api.europeana.eu/record/v2/search.json',
parameters,
});
Expand All @@ -64,7 +63,6 @@ module.exports = class Europeana {

async getRecord ({ id }) {
return this._talk ({
method: 'GET',
url: `https://api.europeana.eu/record/v2/${id}.json`,
});
}
Expand All @@ -91,7 +89,6 @@ module.exports = class Europeana {
* Communicate with API
*
* @param {string} url Request URL
* @param {string} [method=GET] HTTP method
* @param {object} [parameters] Request parameters
* @param {number} [timeout=15000] Request timeout in ms
*
Expand All @@ -100,15 +97,14 @@ module.exports = class Europeana {

async _talk ({
url,
method = 'GET',
parameters = {},
timeout = this._config.timeout,
}) {
const options = {
url,
method,
parameters,
timeout,
method: 'GET',
headers: {
'Accept': 'application/json',
'User-Agent': 'nodejs-europeana',
Expand Down

0 comments on commit c380fbe

Please sign in to comment.