@@ -10,6 +10,7 @@ module Network.HTTP.Affjax
10
10
, post , post_ , post' , post_'
11
11
, put , put_ , put' , put_'
12
12
, delete , delete_
13
+ , patch , patch_ , patch' , patch_'
13
14
, RetryDelayCurve ()
14
15
, RetryPolicy (..)
15
16
, defaultRetryPolicy
@@ -140,6 +141,24 @@ delete u = affjax $ defaultRequest { method = Left DELETE, url = u }
140
141
delete_ :: forall e . URL -> Affjax e Unit
141
142
delete_ = delete
142
143
144
+ -- | Makes a `PATCH` request to the specified URL, sending data.
145
+ patch :: forall e a b . (Requestable a , Respondable b ) => URL -> a -> Affjax e b
146
+ patch u c = affjax $ defaultRequest { method = Left PATCH , url = u, content = Just c }
147
+
148
+ -- | Makes a `PATCH` request to the specified URL with the option to send data.
149
+ patch' :: forall e a b . (Requestable a , Respondable b ) => URL -> Maybe a -> Affjax e b
150
+ patch' u c = affjax $ defaultRequest { method = Left PATCH , url = u, content = c }
151
+
152
+ -- | Makes a `PATCH` request to the specified URL, sending data and ignoring the
153
+ -- | response.
154
+ patch_ :: forall e a . (Requestable a ) => URL -> a -> Affjax e Unit
155
+ patch_ = patch
156
+
157
+ -- | Makes a `PATCH` request to the specified URL with the option to send data,
158
+ -- | and ignores the response.
159
+ patch_' :: forall e a . (Requestable a ) => URL -> Maybe a -> Affjax e Unit
160
+ patch_' = patch'
161
+
143
162
-- | A sequence of retry delays, in milliseconds.
144
163
type RetryDelayCurve = Int -> Int
145
164
@@ -292,4 +311,3 @@ foreign import _cancelAjax
292
311
(Error -> Eff (ajax :: AJAX | e ) Unit )
293
312
(Boolean -> Eff (ajax :: AJAX | e ) Unit )
294
313
(Eff (ajax :: AJAX | e ) Unit )
295
-
0 commit comments