Length Required (411)

Topics: Developer Forum, Project Management Forum, User Forum
Oct 20, 2007 at 6:54 AM
I'm trying to pull out a Photos object. I am encountering an exception each time I try to define the Photos object.

Here is my code:

using FlickrNet;

public partial class _Default : System.Web.UI.Page
{
string strAPI = "xxx";
string strSharedSecret = "xxx";
string strUserID = "xxx";
protected void Page_Load(object sender, EventArgs e)
{
Flickr myFlickr = new Flickr(strAPI, strSharedSecret);
PhotoSearchOptions myPhotoSearchOptions = new PhotoSearchOptions();
myPhotoSearchOptions.UserId = strUserID;
myPhotoSearchOptions.PerPage = 10;
myPhotoSearchOptions.Page = 1;
myPhotoSearchOptions.SortOrder = PhotoSearchSortOrder.DatePostedDesc;
Photos myPhotos = myFlickr.PhotosSearch(myPhotoSearchOptions);
Photo myPhoto = myPhotos.PhotoCollection0;
Image1.ImageUrl = myPhoto.MediumUrl;
}
}

I encounter the exception on this line: Photos myPhotos = myFlickr.PhotosSearch(myPhotoSearchOptions);

I also tried:

using FlickrNet;

public partial class _Default : System.Web.UI.Page
{
string strAPI = "xxx";
string strSharedSecret = "xxx";
string strUserID = "xxx";
protected void Page_Load(object sender, EventArgs e)
{
Flickr myFlickr = new Flickr(strAPI, strSharedSecret);
Photos myPhotos = myFlickr.PeopleGetPublicPhotos(strUserID);
Photo myPhoto = myPhotos.PhotoCollection0;
Image1.ImageUrl = myPhoto.MediumUrl;
}
}

When I do it this way I get the exception on the line: Photos myPhotos = myFlickr.PeopleGetPublicPhotos(strUserID);

What am I doing wrong?
Coordinator
Oct 22, 2007 at 3:28 PM
I haven't had this problem. Are you using the latest version of the library, 2.1.5?
Oct 22, 2007 at 10:34 PM
Don't worry Sam, it is a problem with my ISP at home. I tested it on a different network and it is working fine. From a quick Google of the problem, it seems the transparent proxy utilised by my ISP somehow strips part of the HTTP header. I have no idea why though...