Skip to content

Instantly share code, notes, and snippets.

@ShivamGoyal1899
Created June 12, 2019 10:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ShivamGoyal1899/4cfc0bc3e3583ec8db59d8c9acd7778a to your computer and use it in GitHub Desktop.
Save ShivamGoyal1899/4cfc0bc3e3583ec8db59d8c9acd7778a to your computer and use it in GitHub Desktop.
Future<Album> createAlbum(CreateAlbumRequest request) async {
return http
.post(
'https://photoslibrary.googleapis.com/v1/albums',
body: jsonEncode(request),
headers: await _authHeaders,
)
.then(
(Response response) {
if (response.statusCode != 200) {
print(response.reasonPhrase);
print(response.body);
}
return Album.fromJson(jsonDecode(response.body));
},
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment