Skip to content
This repository was archived by the owner on Jul 10, 2022. It is now read-only.

Commit 49073c2

Browse files
committed
Method is a enum
1 parent a1d940a commit 49073c2

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This are the differences to the PHP version:
1818
Through [NPM](https://www.npmjs.com) as [@chubbyjs/psr-http-message][1].
1919

2020
```sh
21-
npm i @chubbyjs/psr-http-message@1.1.2
21+
npm i @chubbyjs/psr-http-message@1.2.0
2222
```
2323

2424
## Copyright

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@chubbyjs/psr-http-message",
3-
"version": "1.1.2",
3+
"version": "1.2.0",
44
"description": "Common Http-message Interface (PHP FIG PSR-7).",
55
"keywords": [
66
"psr",
@@ -34,5 +34,8 @@
3434
},
3535
"publishConfig": {
3636
"access": "public"
37+
},
38+
"dependencies": {
39+
"@types/node": "^12"
3740
}
3841
}

src/RequestInterface.ts

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
import MessageInterface from './MessageInterface';
22
import UriInterface from './UriInterface';
33

4+
export enum Method {
5+
CONNECT = 'CONNECT',
6+
DELETE = 'DELETE',
7+
GET = 'GET',
8+
HEAD = 'HEAD',
9+
OPTIONS = 'OPTIONS',
10+
PATCH = 'PATCH',
11+
POST = 'POST',
12+
PUT = 'PUT',
13+
TRACE = 'TRACE',
14+
}
15+
416
interface RequestInterface extends MessageInterface {
517
getRequestTarget(): string;
618
withRequestTarget(requestTarget: string): this;
719
getMethod(): string;
8-
withMethod(name: string): this;
20+
withMethod(name: Method): this;
921
getUri(): UriInterface;
1022
withUri(uri: UriInterface, preserveHost?: boolean): this;
1123
}

0 commit comments

Comments
 (0)