@@ -7,8 +7,8 @@ module Network.HTTP.Affjax
77 , affjax
88 , affjax'
99 , get
10- , post , post_
11- , put , put_
10+ , post , post_ , post' , post_'
11+ , put , put_ , put' , put_'
1212 , delete , delete_
1313 ) where
1414
@@ -68,24 +68,51 @@ type URL = String
6868affjax :: forall e a b . (Requestable a , Responsable b ) => AffjaxRequest a -> Affjax e b
6969affjax = makeAff <<< affjax'
7070
71+ -- | Makes a `GET` request to the specified URL.
7172get :: forall e a . (Responsable a ) => URL -> Affjax e a
7273get u = affjax $ defaultRequest { url = u }
7374
75+ -- | Makes a `POST` request to the specified URL, sending data.
7476post :: forall e a b . (Requestable a , Responsable b ) => URL -> a -> Affjax e b
7577post u c = affjax $ defaultRequest { method = POST , url = u, content = Just c }
7678
79+ -- | Makes a `POST` request to the specified URL with the option to send data.
80+ post' :: forall e a b . (Requestable a , Responsable b ) => URL -> Maybe a -> Affjax e b
81+ post' u c = affjax $ defaultRequest { method = POST , url = u, content = c }
82+
83+ -- | Makes a `POST` request to the specified URL, sending data and ignoring the
84+ -- | response.
7785post_ :: forall e a . (Requestable a ) => URL -> a -> Affjax e Unit
7886post_ = post
7987
88+ -- | Makes a `POST` request to the specified URL with the option to send data,
89+ -- | and ignores the response.
90+ post_' :: forall e a . (Requestable a ) => URL -> Maybe a -> Affjax e Unit
91+ post_' = post'
92+
93+ -- | Makes a `PUT` request to the specified URL, sending data.
8094put :: forall e a b . (Requestable a , Responsable b ) => URL -> a -> Affjax e b
8195put u c = affjax $ defaultRequest { method = PUT , url = u, content = Just c }
8296
97+ -- | Makes a `PUT` request to the specified URL with the option to send data.
98+ put' :: forall e a b . (Requestable a , Responsable b ) => URL -> Maybe a -> Affjax e b
99+ put' u c = affjax $ defaultRequest { method = PUT , url = u, content = c }
100+
101+ -- | Makes a `PUT` request to the specified URL, sending data and ignoring the
102+ -- | response.
83103put_ :: forall e a . (Requestable a ) => URL -> a -> Affjax e Unit
84104put_ = put
85105
106+ -- | Makes a `PUT` request to the specified URL with the option to send data,
107+ -- | and ignores the response.
108+ put_' :: forall e a . (Requestable a ) => URL -> Maybe a -> Affjax e Unit
109+ put_' = put'
110+
111+ -- | Makes a `DELETE` request to the specified URL.
86112delete :: forall e a . (Responsable a ) => URL -> Affjax e a
87113delete u = affjax $ defaultRequest { method = DELETE , url = u }
88114
115+ -- | Makes a `DELETE` request to the specified URL and ignores the response.
89116delete_ :: forall e . URL -> Affjax e Unit
90117delete_ = delete
91118
0 commit comments