Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

flickr.photosets.editPhotos() with many photo_ids gives 414 Request-URI Too Large #59

Closed
sybrenstuvel opened this issue Jul 19, 2015 · 6 comments

Comments

@sybrenstuvel
Copy link
Owner

Originally reported by: Dan Connolly (Bitbucket: DanC, GitHub: DanC)


I can call editPhotos() with 100 photo_ids just fine, but when I use 1000, I get:

FlickrError: do_request: Status code 414 received

In do_request, I see it always does HTTP GET:

 req = requests.get(url,
                           params=params,
                           auth=self.oauth,
                           headers={'Connection': 'close'})

Shouldn't it do a POST here?

The flickr docs say, "Note: This method requires an HTTP POST request."


@sybrenstuvel
Copy link
Owner Author

Original comment by Sybren Stüvel (Bitbucket: sybren, GitHub: sybren):


You're right, it should be a POST.

@sybrenstuvel
Copy link
Owner Author

Original comment by Sybren Stüvel (Bitbucket: sybren, GitHub: sybren):


Fix #59 using POST instead of GET

@sybrenstuvel
Copy link
Owner Author

Original comment by Zach Maillard (Bitbucket: sagebrushgis, GitHub: sagebrushgis):


This might be a limitation at Yahoo. I was receiving the same error with the updated code. I manually tried to use the Api Explorer at Flickr https://www.flickr.com/services/api/explore/flickr.photosets.editPhotos with the ID's in question, and received the following error for a set with 980 images:

The requested URL's length exceeds the capacity limit for this server.
Please check the URL for proper spelling and capitalization. If you're having trouble locating a destination on Yahoo!, try visiting the Yahoo! home page or look through a list of Yahoo!'s online services. Also, you may find what you're looking for if you try searching below.

yahoo_api_error.jpg

@sybrenstuvel
Copy link
Owner Author

Original comment by Sybren Stüvel (Bitbucket: sybren, GitHub: sybren):


It makes sense that Yahoo! has limitations as well. It shouldn't be too hard to divide your requests into smaller chunks.

@sybrenstuvel
Copy link
Owner Author

Original comment by Dan Connolly (Bitbucket: DanC, GitHub: DanC):


Use http POST. It doesn't have such low side limits.

Dan Connolly
http://www.madmode.com

@sybrenstuvel
Copy link
Owner Author

Original comment by Sybren Stüvel (Bitbucket: sybren, GitHub: sybren):


I know, which is what happened in commit ffcd6f792660. GET vs POST shouldn't be an issue with the latest (2.1.2) version, as it only performs POST.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant