aboutsummaryrefslogtreecommitdiff
path: root/src/http/mod.rs
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove a few clonesacdenisSK2017-07-291-1/+1
|
* Change the config a bit, and a few nitpicksacdenisSK2017-07-271-405/+648
|
* rustfmtacdenisSK2017-07-271-224/+235
|
* Remove the code meant for debuggingacdenisSK2017-07-241-2/+0
| | | | "Meant" as in, the data frame errors and whatever shenanigans weren't allowing me to
* Revert the ignoring of protocol and data frame errors, while actually ↵acdenisSK2017-07-241-0/+2
| | | | | | handling ping pongs When receiving pings, serenity MUST send the pong with the same data as the ping. Well, as said in the rfc for websockets anyway. Though, regarding the errors, i found out that serenity's gateway wouldn't work, but i do see that i'll have to file an issue to see if they know why are these happening at all
* Add an actual way to fetch audit log entries from a guildacdenisSK2017-07-201-0/+10
|
* Remove the deprecated functionsacdenisSK2017-07-111-18/+0
| | | | It's already been enough time for people to migrate
* Implement attaching reasons to bansacdenisSK2017-07-081-3/+4
|
* Docs fixesmei2017-06-271-3/+2
|
* Add 'wait' parameter to http::execute_webhookZeyla Hellyer2017-06-201-6/+21
| | | | | | The 'wait' parameter allows you to specify waiting for the Message to be sent prior to receiving a response, which will have Discord include the JSON representation of the Message in the body.
* Call send_files from http::send_fileZeyla Hellyer2017-06-141-35/+7
| | | | | | | | | | | | | | | | | | | When made, the `http::send_files` code was duplicated from `http::send_file`. Instead call `http::send_files`, which provides a fix for when an, e.g. 4xx status code, is received, and the library would continue to deserialize the response as usual. This fixes errors like: ``` Err(Json(ErrorImpl { code: Message("missing field `id`"), line: 1, column: 54 })) ``` Instead returning: ``` Err(Http(InvalidRequest(PayloadTooLarge))) ```
* Switch from #[doc(hidden)] to pub(crate)alex2017-06-141-4/+3
| | | | | | Switch from using `#[doc(hidden)]` to hide some internal functions to `pub(crate)`. The library now requires rustc 1.18.
* Use HTTPS Connector with remaining HTTP functionsMaiddog2017-06-141-9/+20
|
* Use an https connector in http::send_filesZeyla Hellyer2017-06-091-1/+5
|
* Make http::send_files accept a slice of bytesZeyla Hellyer2017-06-041-4/+13
| | | | | | Sometimes a user might be working with a buffer of bytes in-memory and not writing to the disk, so `http::AttachmentType` should accept an &[u8].
* Make http::AttachmentType only use borrowed valuesZeyla Hellyer2017-06-041-14/+16
| | | | | With the way AttachmentType is meant to be used by `http::send_files`, none of the values need to be moved, they only need to be borrowed.
* Fix compilations across feature combinationsZeyla Hellyer2017-06-021-1/+2
|
* Implement multiple attachmentsKen Swenson2017-05-281-0/+86
|
* Fix incorrect attempted send_file deserializationZeyla Hellyer2017-05-271-0/+12
| | | | | | | | | | | If http::send_file received a non-success status code due to reasons such as sending to an invalid channel Id, not having permissions, or sending too large of a file, then it would still try to deserialize a response as if it were valid. To fix this, ensure that the response is successful. Document that if the file sent is too large, then `HttpError::InvalidRequest(PayloadTooLarge)` is returned.
* Fix broken docs links in http moduleZeyla Hellyer2017-05-241-43/+43
|
* Restructure modulesZeyla Hellyer2017-05-221-0/+1544
Modules are now separated into a fashion where the library can be used for most use cases, without needing to compile the rest. The core of serenity, with no features enabled, contains only the struct (model) definitions, constants, and prelude. Models do not have most functions compiled in, as that is separated into the `model` feature. The `client` module has been split into 3 modules: `client`, `gateway`, and `http`. `http` contains functions to interact with the REST API. `gateway` contains the Shard to interact with the gateway, requiring `http` for retrieving the gateway URL. `client` requires both of the other features and acts as an abstracted interface over both the gateway and REST APIs, handling the event loop. The `builder` module has been separated from `utils`, and can now be optionally compiled in. It and the `http` feature are required by the `model` feature due to a large number of methods requiring access to them. `utils` now contains a number of utilities, such as the Colour struct, the `MessageBuilder`, and mention parsing functions. Each of the original `ext` modules are still featured, with `cache` not requiring any feature to be enabled, `framework` requiring the `client`, `model`, and `utils`, and `voice` requiring `gateway`. In total the features and their requirements are: - `builder`: none - `cache`: none - `client`: `gateway`, `http` - `framework`: `client`, `model`, `utils` - `gateway`: `http` - `http`: none - `model`: `builder`, `http` - `utils`: none - `voice`: `gateway` The default features are `builder`, `cache`, `client`, `framework`, `gateway`, `model`, `http`, and `utils`. To help with forwards compatibility, modules have been re-exported from their original locations.