diff options
| author | Ariel Shadkhan <[email protected]> | 2020-10-01 16:42:48 +0300 |
|---|---|---|
| committer | Ariel Shadkhan <[email protected]> | 2020-10-01 16:42:48 +0300 |
| commit | c4cf1eefded907e38377bdf0dbd37ff829add13a (patch) | |
| tree | 362069bc80e9935dddb2937618f17fdf34daeec0 /lib | |
| parent | 91dc8a3372426bc691be56153b33e81a16459f49 (diff) | |
| download | faker-c4cf1eefded907e38377bdf0dbd37ff829add13a.tar.xz faker-c4cf1eefded907e38377bdf0dbd37ff829add13a.zip | |
add httpMethod and unit test
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/internet.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/internet.js b/lib/internet.js index 658607a1..9d322d48 100644 --- a/lib/internet.js +++ b/lib/internet.js @@ -132,6 +132,21 @@ var Internet = function (faker) { }; /** + * method + * + * @method faker.internet.httpMethod + */ + self.httpMethod = function () { + var httpMethods = ['GET','POST', 'PUT', 'DELETE', 'PATCH']; + return faker.random.arrayElement(httpMethods); + }; + + self.httpMethod.schema = { + "description": "Randomly generates HTTP Methods (GET, POST, PUT, DELETE, PATCH)", + "sampleResults": ["GET","POST", "PUT", "DELETE", "PATCH"] + }; + + /** * url * * @method faker.internet.url |
