Skip to content

Commit

Permalink
Add support for the OPTIONS HTTP method.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkiro committed Dec 10, 2018
1 parent 0e8f437 commit aba986f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/hock.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,23 @@ Hock.prototype.copy = function (url, body, headers) {
});
};

/**
* Hock.options
*
* @description enqueue a OPTIONS request into the assertion queue
*
* @param {String} url the route of the request to match
* @param {object} [headers] optionally match the request headers
* @returns {Request}
*/
Hock.prototype.options = function (url, headers) {
return new Request(this, {
method: 'OPTIONS',
url: url,
headers: headers || {}
});
};

/**
* Hock.filteringRequestBody
*
Expand Down

0 comments on commit aba986f

Please sign in to comment.