Commit Graph

7 Commits

Author SHA1 Message Date
Koen Bolhuis c49f40128d Use the attohttpc crate instead of ureq.
This has some implications for Error:
- because attohttpc doesn't distinguish between errors
  when serializing or deserializing request/response
  data, Error::RequestJson and Error::ResponseJson have
  been merged into Error::Json. In practice this shouldn't
  matter much because request data is (usually) well-formed.
- attohttpc also doesn't return errors for HTTP responses
  with statuses in the [400-599] range, so manual conversion
  to an error is needed (this now happens in ResponseType::from_response).
2021-09-01 18:04:56 +02:00
Koen Bolhuis b4c4226677 Represent invalid tokens with an error instead of a boolean 2021-01-20 00:52:10 +01:00
Koen Bolhuis 7f07ecfb32 Add ListenBrainz type
The ListenBrainz struct is a more ergonomic client
than raw::Client. It supports authentication using
a ListenBrainz token. Currently, it allows submitting
"listened" and "now playing" requests to the API
in a more convenient way than manually creating all
request data.
2021-01-20 00:16:53 +01:00
Koen Bolhuis 3588436e53 Run rustfmt 2021-01-13 14:28:59 +01:00
Koen Bolhuis 9581ce45cb Box ureq::Error because it is 1000+ bytes 2021-01-13 14:28:28 +01:00
Koen Bolhuis 7f5d67ba74 Document Error::ApiError fields 2021-01-13 13:05:50 +01:00
Koen Bolhuis 14428576a8 Extract Error to error module 2021-01-10 19:30:03 +01:00