get method

Request<Photo> get(
  1. String id
)

Get a photo

Retrieve a single photo.

See: Unsplash docs

Implementation

Request<Photo> get(String id) {
  final url = baseUrl.resolve(id);

  return Request(
    client: client,
    httpRequest: http.Request('GET', url),
    isPublicAction: true,
    bodyDeserializer: (dynamic json) =>
        Photo.fromJson(json as Map<String, dynamic>),
  );
}