Hi all,
i am trying to upload the image on the Album of my account.But above
specified error is received. Please suggest where I do the mistake.
code is following

-(NSData *)setProfilePhoto:(NSData *)photoContent
{
        NSString *urlString1 = [NSString stringWithFormat:@"http://
picasaweb.google.com/data/feed/api/user/rup28...@gmail.com/albumid/
default"];
        //NSString *urlString1 = [NSString stringWithFormat:@"http://
picasaweb.google.com/data/feed/api/user/rup28...@gmail.com/albumid/
108075885848736134359"];

        NSString *result;
        NSData *responseData;
        @try {
                //NSURL *url = [[NSURL alloc] initWithString:urlString1];
//              NSMutableURLRequest *req = [[NSMutableURLRequest alloc]
initWithURL:url];
//              [req setHTTPMethod:@"POST"];

                NSString *postLength = [NSString stringWithFormat:@"%d",
[photoContent length]];

                NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] 
init]
autorelease];
                [request setURL:[NSURL URLWithString:urlString1]];
                [request setHTTPMethod:@"POST"];
                soapTestAppDelegate *appDelegate = (soapTestAppDelegate *)
[[UIApplication sharedApplication] delegate];

        // post without metadata
                [request setValue:@"image/jpeg" 
forHTTPHeaderField:@"Content-Type"];
                [request setValue:postLength 
forHTTPHeaderField:@"Content-Length"];
                [request setValue:@"abc.jpg" forHTTPHeaderField:@"Slug"];
                NSString* authorizationString = [NSString
stringWithFormat:@"GoogleLogin auth=%@",appDelegate.PicasaAuth];
        //[request setValue:authorizationString
forHTTPHeaderField:@"Authorization"];
        [request setValue:@"2" forHTTPHeaderField:@"GData-Version"];

                [request setHTTPBody:photoContent];

                NSHTTPURLResponse* response = nil;
                NSError* error = [[NSError alloc] init];
                NSLog(@"Request : %@", request);
                responseData = [NSURLConnection sendSynchronousRequest:request
returningResponse:&response error:&error];
                result = [[NSString alloc] initWithData:responseData
encoding:NSUTF8StringEncoding];
                NSLog(@"Response Code: %d", [response statusCode]);
                NSLog(@"Result: %@", result);
                //[url release];
                [request release];
        }
        @catch (NSException* ex) {
                NSLog(@"Error: %@",ex);
        }
        return responseData;



}

-- 
You received this message because you are subscribed to the Google Groups 
"Google Picasa Web Albums API" group.
To post to this group, send email to google-picasa-data-...@googlegroups.com.
To unsubscribe from this group, send email to 
google-picasa-data-api+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-picasa-data-api?hl=en.

Reply via email to