A collection of Rust crates for interacting with the iNaturalist API.

Upload files from bytes and fix observation taxon types #26

Closed rwell.org
targeting main from kueda.net/rust-inaturalist:upload-bytes-and-write-fixes
Closed opened by and assigned to rwell.org
targeting main from kueda.net/rust-inaturalist:upload-bytes-and-write-fixes
  • File parameters (photos, sounds, user icon, taxa suggest image) take an inaturalist::Upload holding the file's bytes, name, and MIME type instead of a path the client streams from disk. This drops the tokio and tokio-util dependencies. This should be more useful for moving a photo from a PDS to iNat, but it probably has memory implications you might not like; happy to rework it
  • An observation's taxon_id and taxon_name are an integer and a string on create and update. The v2 spec declares both as numbers.
  • Add request-shape tests for the v2 observation and observation photo POSTs against a mock server.
  • Allow a custom redirect_uri to be specified

FWIW, this also adds CLI spike to test out posting. LMK if you want to remove that, but I found it useful for proving this works. I could also generalize it so it does more than just POSTing and call it inat-cli or something.

This is also going to require a version bump, but I didn't do that here.

Commits 0