Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4005512
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:24:09+00:00 2026-05-20T08:24:09+00:00

How should I build the entity to achieve this post request? POST https://picasaweb.google.com/data/feed/api/user/userID/albumid/albumID/photoid/photoID <entry

  • 0

How should I build the entity to achieve this post request?

POST https://picasaweb.google.com/data/feed/api/user/userID/albumid/albumID/photoid/photoID

<entry xmlns='http://www.w3.org/2005/Atom'>
  <content>great photo!</content>
  <category scheme="http://schemas.google.com/g/2005#kind"
    term="http://schemas.google.com/photos/2007#comment"/>
</entry>

It’s from:
http://code.google.com/intl/zh-TW/apis/picasaweb/docs/2.0/developers_guide_protocol.html#AddComments

Could someone provide an example or any tips?
Many thanks.

UPDATE:
I added my code here:

        List<Header> headers = new ArrayList<Header>();
    headers.add(new BasicHeader("GData-Version", "2"));
    headers.add(new BasicHeader("Authorization", "GoogleLogin auth=" + mAuthToken));

    EntityTemplate entity = new EntityTemplate(new ContentProducer() {
        public void writeTo(OutputStream ostream) throws IOException {
            Writer writer = new OutputStreamWriter(ostream, "UTF-8");

            writer.write("\r\n");
            writer.write("<entry xmlns='http://www.w3.org/2005/Atom'>");
            writer.write("<content>" + comment + "</content>");
            writer.write("<category scheme=\"http://schemas.google.com/g/2005#kind\"\r\n");
            writer.write("term=\"http://schemas.google.com/photos/2007#comment\"/>");
            writer.write("</entry>\r\n");

            writer.flush();
        }
    });

Still no luck. Any idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T08:24:10+00:00Added an answer on May 20, 2026 at 8:24 am

    It is a sample code using HttpClient.

    I hope this piece of information will be of help to you.

    // yourID
    String userID = "";
    String albumID = "";
    String photoID = "";
    
    HttpPost postRequest = new HttpPost(
        "https://picasaweb.google.com/data/feed/api/user/" + userID
        + "/albumid/" + albumID + "/photoid/" + photoID);
    
    postRequest.addHeader(new BasicHeader("GData-Version", "2.0"));
    postRequest.addHeader(new BasicHeader("Authorization",
        "GoogleLogin auth=" + mAuthToken));
    
    String content = 
        "<entry xmlns='http://www.w3.org/2005/Atom'>"
        + "<content>" + comment + "</content>"
        + "<category scheme='http://schemas.google.com/g/2005#kind'"
        + " term='http://schemas.google.com/photos/2007#comment'/>"
        + "</entry>";
    
    try {
        StringEntity entity = new StringEntity(content);
        entity.setContentType(new BasicHeader("Content-Type",
            "application/atom+xml"));
        postRequest.setEntity(entity);
    
        HttpClient httpclient = new DefaultHttpClient();
        HttpResponse response = httpclient.execute(postRequest);
    
    } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
    } catch (ClientProtocolException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently trying to build a simple component which should monitor, if the user
I want to build a form entity, which should contain form form fields, so
I'm working on porting a Visual C++ application to GCC (should build on MingW
I would like to hear other people's advice on when one should build a
I'm building an application where I should capture several values and build a text
my iPhone application should store some data persistantly by using Core Data functionality. Here
I use ADO.NET Entity-Framework, I have a page that is data-bound to an entity
I'm trying to build a Chrome browser extension, that should enhance the way the
My organization builds a C++ application that runs on multiple operating systems. Should the
I have ci , so our staging environment builds itself. Should I have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.