Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with updating profile pic. #89

Open
sweetie85 opened this issue Jun 17, 2011 · 0 comments
Open

Problem with updating profile pic. #89

sweetie85 opened this issue Jun 17, 2011 · 0 comments

Comments

@sweetie85
Copy link

Hi,

I am using the following code to update profile pic:

  • (NSString *)setBackgroundimage:(NSString *)imageurl{

    if (!imageurl) {
    return nil;
    }

    NSString *path = [NSString stringWithFormat:@"account/update_profile_image.%@", API_FORMAT];

    imageurl = [imageurl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSString *trimmedLocation = imageurl;

    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:0];
    [params setObject:trimmedLocation forKey:@"profile_image_url"];
    NSString *body = [self _queryStringWithBase:nil parameters:params prefixed:NO];

    return [self _sendRequestWithMethod:HTTP_POST_METHOD path:path
    queryParameters:params body:body
    requestType:MGTwitterAccountLocationRequest
    responseType:MGTwitterUser];
    }

where url is the url to the image. When I ma trying to use the above code to update profile pic. I get the following error:
Error Message:Request 6397A72F-BF61-42B7-8B50-BA7F62CBFEC4 failed with error: Error Domain=HTTP Code=500

Any help is appreciated.

Thanks.

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

No branches or pull requests

1 participant