@@ -7,8 +7,8 @@ module Network.HTTP.Affjax
7
7
, affjax
8
8
, affjax'
9
9
, get
10
- , post , post_
11
- , put , put_
10
+ , post , post_ , post' , post_'
11
+ , put , put_ , put' , put_'
12
12
, delete , delete_
13
13
) where
14
14
@@ -68,24 +68,51 @@ type URL = String
68
68
affjax :: forall e a b . (Requestable a , Responsable b ) => AffjaxRequest a -> Affjax e b
69
69
affjax = makeAff <<< affjax'
70
70
71
+ -- | Makes a `GET` request to the specified URL.
71
72
get :: forall e a . (Responsable a ) => URL -> Affjax e a
72
73
get u = affjax $ defaultRequest { url = u }
73
74
75
+ -- | Makes a `POST` request to the specified URL, sending data.
74
76
post :: forall e a b . (Requestable a , Responsable b ) => URL -> a -> Affjax e b
75
77
post u c = affjax $ defaultRequest { method = POST , url = u, content = Just c }
76
78
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.
77
85
post_ :: forall e a . (Requestable a ) => URL -> a -> Affjax e Unit
78
86
post_ = post
79
87
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.
80
94
put :: forall e a b . (Requestable a , Responsable b ) => URL -> a -> Affjax e b
81
95
put u c = affjax $ defaultRequest { method = PUT , url = u, content = Just c }
82
96
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.
83
103
put_ :: forall e a . (Requestable a ) => URL -> a -> Affjax e Unit
84
104
put_ = put
85
105
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.
86
112
delete :: forall e a . (Responsable a ) => URL -> Affjax e a
87
113
delete u = affjax $ defaultRequest { method = DELETE , url = u }
88
114
115
+ -- | Makes a `DELETE` request to the specified URL and ignores the response.
89
116
delete_ :: forall e . URL -> Affjax e Unit
90
117
delete_ = delete
91
118
0 commit comments