|
| 1 | +# Module Documentation |
| 2 | + |
| 3 | +## Module Network.HTTP.Affjax |
| 4 | + |
| 5 | +#### `AJAX` |
| 6 | + |
| 7 | +``` purescript |
| 8 | +data AJAX :: ! |
| 9 | +``` |
| 10 | + |
| 11 | +The effect type for AJAX requests made with Affjax. |
| 12 | + |
| 13 | +#### `Affjax` |
| 14 | + |
| 15 | +``` purescript |
| 16 | +type Affjax e a = Aff (ajax :: AJAX | e) (AffjaxResponse a) |
| 17 | +``` |
| 18 | + |
| 19 | +The type for Affjax requests. |
| 20 | + |
| 21 | +#### `AffjaxRequest` |
| 22 | + |
| 23 | +``` purescript |
| 24 | +type AffjaxRequest a = { password :: Maybe String, username :: Maybe String, content :: Maybe a, headers :: [RequestHeader], url :: URL, method :: Method } |
| 25 | +``` |
| 26 | + |
| 27 | + |
| 28 | +#### `defaultRequest` |
| 29 | + |
| 30 | +``` purescript |
| 31 | +defaultRequest :: AffjaxRequest Unit |
| 32 | +``` |
| 33 | + |
| 34 | + |
| 35 | +#### `AffjaxResponse` |
| 36 | + |
| 37 | +``` purescript |
| 38 | +type AffjaxResponse a = { response :: a, headers :: [ResponseHeader], status :: StatusCode } |
| 39 | +``` |
| 40 | + |
| 41 | +The type of records that will be received as an Affjax response. |
| 42 | + |
| 43 | +#### `URL` |
| 44 | + |
| 45 | +``` purescript |
| 46 | +type URL = String |
| 47 | +``` |
| 48 | + |
| 49 | +Type alias for URL strings to aid readability of types. |
| 50 | + |
| 51 | +#### `affjax` |
| 52 | + |
| 53 | +``` purescript |
| 54 | +affjax :: forall e a b. (Requestable a, Respondable b) => AffjaxRequest a -> Affjax e b |
| 55 | +``` |
| 56 | + |
| 57 | +Makes an `Affjax` request. |
| 58 | + |
| 59 | +#### `get` |
| 60 | + |
| 61 | +``` purescript |
| 62 | +get :: forall e a. (Respondable a) => URL -> Affjax e a |
| 63 | +``` |
| 64 | + |
| 65 | +Makes a `GET` request to the specified URL. |
| 66 | + |
| 67 | +#### `post` |
| 68 | + |
| 69 | +``` purescript |
| 70 | +post :: forall e a b. (Requestable a, Respondable b) => URL -> a -> Affjax e b |
| 71 | +``` |
| 72 | + |
| 73 | +Makes a `POST` request to the specified URL, sending data. |
| 74 | + |
| 75 | +#### `post'` |
| 76 | + |
| 77 | +``` purescript |
| 78 | +post' :: forall e a b. (Requestable a, Respondable b) => URL -> Maybe a -> Affjax e b |
| 79 | +``` |
| 80 | + |
| 81 | +Makes a `POST` request to the specified URL with the option to send data. |
| 82 | + |
| 83 | +#### `post_` |
| 84 | + |
| 85 | +``` purescript |
| 86 | +post_ :: forall e a. (Requestable a) => URL -> a -> Affjax e Unit |
| 87 | +``` |
| 88 | + |
| 89 | +Makes a `POST` request to the specified URL, sending data and ignoring the |
| 90 | +response. |
| 91 | + |
| 92 | +#### `post_'` |
| 93 | + |
| 94 | +``` purescript |
| 95 | +post_' :: forall e a. (Requestable a) => URL -> Maybe a -> Affjax e Unit |
| 96 | +``` |
| 97 | + |
| 98 | +Makes a `POST` request to the specified URL with the option to send data, |
| 99 | +and ignores the response. |
| 100 | + |
| 101 | +#### `put` |
| 102 | + |
| 103 | +``` purescript |
| 104 | +put :: forall e a b. (Requestable a, Respondable b) => URL -> a -> Affjax e b |
| 105 | +``` |
| 106 | + |
| 107 | +Makes a `PUT` request to the specified URL, sending data. |
| 108 | + |
| 109 | +#### `put'` |
| 110 | + |
| 111 | +``` purescript |
| 112 | +put' :: forall e a b. (Requestable a, Respondable b) => URL -> Maybe a -> Affjax e b |
| 113 | +``` |
| 114 | + |
| 115 | +Makes a `PUT` request to the specified URL with the option to send data. |
| 116 | + |
| 117 | +#### `put_` |
| 118 | + |
| 119 | +``` purescript |
| 120 | +put_ :: forall e a. (Requestable a) => URL -> a -> Affjax e Unit |
| 121 | +``` |
| 122 | + |
| 123 | +Makes a `PUT` request to the specified URL, sending data and ignoring the |
| 124 | +response. |
| 125 | + |
| 126 | +#### `put_'` |
| 127 | + |
| 128 | +``` purescript |
| 129 | +put_' :: forall e a. (Requestable a) => URL -> Maybe a -> Affjax e Unit |
| 130 | +``` |
| 131 | + |
| 132 | +Makes a `PUT` request to the specified URL with the option to send data, |
| 133 | +and ignores the response. |
| 134 | + |
| 135 | +#### `delete` |
| 136 | + |
| 137 | +``` purescript |
| 138 | +delete :: forall e a. (Respondable a) => URL -> Affjax e a |
| 139 | +``` |
| 140 | + |
| 141 | +Makes a `DELETE` request to the specified URL. |
| 142 | + |
| 143 | +#### `delete_` |
| 144 | + |
| 145 | +``` purescript |
| 146 | +delete_ :: forall e. URL -> Affjax e Unit |
| 147 | +``` |
| 148 | + |
| 149 | +Makes a `DELETE` request to the specified URL and ignores the response. |
| 150 | + |
| 151 | +#### `affjax'` |
| 152 | + |
| 153 | +``` purescript |
| 154 | +affjax' :: forall e a b. (Requestable a, Respondable b) => AffjaxRequest a -> (Error -> Eff (ajax :: AJAX | e) Unit) -> (AffjaxResponse b -> Eff (ajax :: AJAX | e) Unit) -> Eff (ajax :: AJAX | e) (Canceler (ajax :: AJAX | e)) |
| 155 | +``` |
| 156 | + |
| 157 | +Run a request directly without using `Aff`. |
| 158 | + |
| 159 | + |
| 160 | + |
0 commit comments