File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,14 @@ responseAsStream :: forall eff w a. Response -> Readable w (http :: HTTP | eff)
126126
127127Create a readable stream from a response object.
128128
129+ #### ` setTimeout `
130+
131+ ``` purescript
132+ setTimeout :: forall eff. Request -> Int -> Eff (http :: HTTP | eff) Unit -> Eff (http :: HTTP | eff) Unit
133+ ```
134+
135+ Set the socket timeout for a ` Request `
136+
129137#### ` httpVersion `
130138
131139``` purescript
Original file line number Diff line number Diff line change @@ -13,3 +13,13 @@ exports.requestImpl = function(opts) {
1313 } ;
1414 } ;
1515} ;
16+
17+ exports . setTimeout = function ( r ) {
18+ return function ( ms ) {
19+ return function ( k ) {
20+ return function ( ) {
21+ r . setTimeout ( ms , k ) ;
22+ } ;
23+ } ;
24+ } ;
25+ } ;
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ module Node.HTTP.Client
1616 , requestFromURI
1717 , requestAsStream
1818 , responseAsStream
19+ , setTimeout
1920 , httpVersion
2021 , responseHeaders
2122 , statusCode
@@ -96,6 +97,9 @@ requestAsStream = unsafeCoerce
9697responseAsStream :: forall eff w a . Response -> Readable w (http :: HTTP | eff ) a
9798responseAsStream = unsafeCoerce
9899
100+ -- | Set the socket timeout for a `Request`
101+ foreign import setTimeout :: forall eff . Request -> Int -> Eff (http :: HTTP | eff ) Unit -> Eff (http :: HTTP | eff ) Unit
102+
99103-- | Get the request HTTP version
100104httpVersion :: Response -> String
101105httpVersion = _.httpVersion <<< unsafeCoerce
You can’t perform that action at this time.
0 commit comments