| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2d8dbe8 commit cc90d11
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -723,6 +723,16 @@ deprecated: v13.0.0 | |||
| 723 | 723 | ||
| 724 | 724 | See [`request.socket`][]. | |
| 725 | 725 | ||
| 726 | + ### `request.cork()` | ||
| 727 | + | ||
| 728 | + <!-- YAML | ||
| 729 | + added: | ||
| 730 | + - v13.2.0 | ||
| 731 | + - v12.16.0 | ||
| 732 | + --> | ||
| 733 | + | ||
| 734 | + See [`writable.cork()`][]. | ||
| 735 | + | ||
| 726 | 736 | ### `request.end([data[, encoding]][, callback])` | |
| 727 | 737 | ||
| 728 | 738 | <!-- YAML | |
@@ -840,6 +850,52 @@ const cookie = request.getHeader('Cookie'); | |||
| 840 | 850 | // 'cookie' is of type string[] | |
| 841 | 851 | ``` | |
| 842 | 852 | ||
| 853 | + ### `request.getHeaderNames()` | ||
| 854 | + | ||
| 855 | + <!-- YAML | ||
| 856 | + added: v7.7.0 | ||
| 857 | + --> | ||
| 858 | + | ||
| 859 | + * Returns: {string\[]} | ||
| 860 | + | ||
| 861 | + Returns an array containing the unique names of the current outgoing headers. | ||
| 862 | + All header names are lowercase. | ||
| 863 | + | ||
| 864 | + ```js | ||
| 865 | + request.setHeader('Foo', 'bar'); | ||
| 866 | + request.setHeader('Cookie', ['foo=bar', 'bar=baz']); | ||
| 867 | + | ||
| 868 | + const headerNames = request.getHeaderNames(); | ||
| 869 | + // headerNames === ['foo', 'Cookie'] | ||
| 870 | + ``` | ||
| 871 | + | ||
| 872 | + ### `request.getHeaders()` | ||
| 873 | + | ||
| 874 | + <!-- YAML | ||
| 875 | + added: v7.7.0 | ||
| 876 | + --> | ||
| 877 | + | ||
| 878 | + * Returns: {Object} | ||
| 879 | + | ||
| 880 | + Returns a shallow copy of the current outgoing headers. Since a shallow copy | ||
| 881 | + is used, array values may be mutated without additional calls to various | ||
| 882 | + header-related http module methods. The keys of the returned object are the | ||
| 883 | + header names and the values are the respective header values. All header names | ||
| 884 | + are lowercase. | ||
| 885 | + | ||
| 886 | + The object returned by the `response.getHeaders()` method _does not_ | ||
| 887 | + prototypically inherit from the JavaScript `Object`. This means that typical | ||
| 888 | + `Object` methods such as `obj.toString()`, `obj.hasOwnProperty()`, and others | ||
| 889 | + are not defined and _will not work_. | ||
| 890 | + | ||
| 891 | + ```js | ||
| 892 | + request.setHeader('Foo', 'bar'); | ||
| 893 | + request.setHeader('Cookie', ['foo=bar', 'bar=baz']); | ||
| 894 | + | ||
| 895 | + const headers = response.getHeaders(); | ||
| 896 | + // headers === { foo: 'bar', 'cookie': ['foo=bar', 'bar=baz'] } | ||
| 897 | + ``` | ||
| 898 | + | ||
| 843 | 899 | ### `request.getRawHeaderNames()` | |
| 844 | 900 | ||
| 845 | 901 | <!-- YAML | |
@@ -859,6 +915,22 @@ const headerNames = request.getRawHeaderNames(); | |||
| 859 | 915 | // headerNames === ['Foo', 'Set-Cookie'] | |
| 860 | 916 | ``` | |
| 861 | 917 | ||
| 918 | + ### `request.hasHeader(name)` | ||
| 919 | + | ||
| 920 | + <!-- YAML | ||
| 921 | + added: v7.7.0 | ||
| 922 | + --> | ||
| 923 | + | ||
| 924 | + * `name` {string} | ||
| 925 | + * Returns: {boolean} | ||
| 926 | + | ||
| 927 | + Returns `true` if the header identified by `name` is currently set in the | ||
| 928 | + outgoing headers. The header name matching is case-insensitive. | ||
| 929 | + | ||
| 930 | + ```js | ||
| 931 | + const hasContentType = request.hasHeader('content-type'); | ||
| 932 | + ``` | ||
| 933 | + | ||
| 862 | 934 | ### `request.maxHeadersCount` | |
| 863 | 935 | ||
| 864 | 936 | * {number} **Default:** `2000` | |
@@ -1082,6 +1154,16 @@ This property is guaranteed to be an instance of the {net.Socket} class, | |||
| 1082 | 1154 | a subclass of {stream.Duplex}, unless the user specified a socket | |
| 1083 | 1155 | type other than {net.Socket}. | |
| 1084 | 1156 | ||
| 1157 | + ### `request.uncork()` | ||
| 1158 | + | ||
| 1159 | + <!-- YAML | ||
| 1160 | + added: | ||
| 1161 | + - v13.2.0 | ||
| 1162 | + - v12.16.0 | ||
| 1163 | + --> | ||
| 1164 | + | ||
| 1165 | + See [`writable.uncork()`][]. | ||
| 1166 | + | ||
| 1085 | 1167 | ### `request.writableEnded` | |
| 1086 | 1168 | ||
| 1087 | 1169 | <!-- YAML | |
| Back | FazBrowse Home | New Git URL |
0 commit comments