@@ -729,6 +729,16 @@ deprecated: v13.0.0
729
729
730
730
See [ ` request.socket ` ] [ ] .
731
731
732
+ ### ` request.cork() `
733
+
734
+ <!-- YAML
735
+ added:
736
+ - v13.2.0
737
+ - v12.16.0
738
+ -->
739
+
740
+ See [ ` writable.cork() ` ] [ ] .
741
+
732
742
### ` request.end([data[, encoding]][, callback]) `
733
743
734
744
<!-- YAML
@@ -846,6 +856,52 @@ const cookie = request.getHeader('Cookie');
846
856
// 'cookie' is of type string[]
847
857
```
848
858
859
+ ### ` request.getHeaderNames() `
860
+
861
+ <!-- YAML
862
+ added: v7.7.0
863
+ -->
864
+
865
+ * Returns: {string\[ ] }
866
+
867
+ Returns an array containing the unique names of the current outgoing headers.
868
+ All header names are lowercase.
869
+
870
+ ``` js
871
+ request .setHeader (' Foo' , ' bar' );
872
+ request .setHeader (' Cookie' , [' foo=bar' , ' bar=baz' ]);
873
+
874
+ const headerNames = request .getHeaderNames ();
875
+ // headerNames === ['foo', 'Cookie']
876
+ ```
877
+
878
+ ### ` request.getHeaders() `
879
+
880
+ <!-- YAML
881
+ added: v7.7.0
882
+ -->
883
+
884
+ * Returns: {Object}
885
+
886
+ Returns a shallow copy of the current outgoing headers. Since a shallow copy
887
+ is used, array values may be mutated without additional calls to various
888
+ header-related http module methods. The keys of the returned object are the
889
+ header names and the values are the respective header values. All header names
890
+ are lowercase.
891
+
892
+ The object returned by the ` response.getHeaders() ` method _ does not_
893
+ prototypically inherit from the JavaScript ` Object ` . This means that typical
894
+ ` Object ` methods such as ` obj.toString() ` , ` obj.hasOwnProperty() ` , and others
895
+ are not defined and _ will not work_ .
896
+
897
+ ``` js
898
+ request .setHeader (' Foo' , ' bar' );
899
+ request .setHeader (' Cookie' , [' foo=bar' , ' bar=baz' ]);
900
+
901
+ const headers = response .getHeaders ();
902
+ // headers === { foo: 'bar', 'cookie': ['foo=bar', 'bar=baz'] }
903
+ ```
904
+
849
905
### ` request.getRawHeaderNames() `
850
906
851
907
<!-- YAML
@@ -867,6 +923,22 @@ const headerNames = request.getRawHeaderNames();
867
923
// headerNames === ['Foo', 'Set-Cookie']
868
924
```
869
925
926
+ ### ` request.hasHeader(name) `
927
+
928
+ <!-- YAML
929
+ added: v7.7.0
930
+ -->
931
+
932
+ * ` name ` {string}
933
+ * Returns: {boolean}
934
+
935
+ Returns ` true ` if the header identified by ` name ` is currently set in the
936
+ outgoing headers. The header name matching is case-insensitive.
937
+
938
+ ``` js
939
+ const hasContentType = request .hasHeader (' content-type' );
940
+ ```
941
+
870
942
### ` request.maxHeadersCount `
871
943
872
944
* {number} ** Default:** ` 2000 `
@@ -1090,6 +1162,16 @@ This property is guaranteed to be an instance of the {net.Socket} class,
1090
1162
a subclass of {stream.Duplex}, unless the user specified a socket
1091
1163
type other than {net.Socket}.
1092
1164
1165
+ ### ` request.uncork() `
1166
+
1167
+ <!-- YAML
1168
+ added:
1169
+ - v13.2.0
1170
+ - v12.16.0
1171
+ -->
1172
+
1173
+ See [ ` writable.uncork() ` ] [ ] .
1174
+
1093
1175
### ` request.writableEnded `
1094
1176
1095
1177
<!-- YAML
0 commit comments