Hitting 413 (Request Too Large) error on flickr.photosets.editPhotos
wwarby opened this issue · 3 comments
I'm attempting to update a photoset with several hundred photos in it, and hitting a 413 response (request too large). Here's what I'm doing:
flickr.photosets.editPhotos({
photoset_id: albumId,
photo_ids: photoIds.join(','), // Several hundred IDs in this array
primary_photo_id: primaryPhotoId
})
I can see from the error response that the bit long set of photo IDs is being passed as a query string param, despite the method being POST
:
https://api.flickr.com/services/rest?method=flickr.photosets.editPhotos&photoset_id=72157720077649915&photo_ids=51545392449%2C51545579665%2C51544622751%2C51545369594%2C51545330174...
Is there any way to coerce the library to send the parameters of this method as a post body rather than as a query string? I couldn't see anything obvious in the documentation, but it looks as though the Flickr API itself should support this in principle.
I've tracked down the cause of this issue I think and hacked in a fix that works - at least for my use case.
flickr-sdk/script/build-rest.ejs
Line 96 in df3108b
Replacing this line with .param(args)
makes the problem go away. Is this a bug I've stumbled over with an easy fix?
Thanks for the bug fix! This should be fixed in v5.0.0.