title: Inserting data into Google spreadsheet with Google Spreadsheet Java API
body: <p>the following is the code that I am using to insert data. It is picked up from the samples which Google provided. </p>
  
  <pre><code>// Get the spreadsheet feed
          SpreadsheetFeed feed = client
                  .getFeed(
                          new URL(
                                  "https://spreadsheets.google.com/feeds/spreadsheets/private/full"),
                          SpreadsheetFeed.class);
          // Get the worksheet
          WorksheetEntry worksheet = feed.getEntries().get(0).getWorksheets()
                  .get(0);
  
          URL listFeed = worksheet.getListFeedUrl();
          ListEntry newEntry = new ListEntry();
  
          String nameValuePairs = "a=b,c=d";
  
          for (String nameValuePair : nameValuePairs.split(",")) {
  
              // Then, split by the equal sign.
              String[] parts = nameValuePair.split("=", 2);
              String tag = parts[0]; // such as "name"
              String value = parts[1]; // such as "Fred"
  
              newEntry.getCustomElements().setValueLocal(tag, value);
          }
  
          client.insert(listFeed, newEntry);
  </code></pre>
  
  <p>What I am trying to do there is to get a worksheet and insert a row of data into it. No matter how much I try, I am not able to make it work. I get the following error whenever I run it on client.insert()</p>
  
  <pre><code>com.google.gdata.util.InvalidEntryException: Bad Request
  </code></pre>
  
  <p><code>We&amp;#39;re sorry, a server error occurred. Please wait a bit and try reloading your spreadsheet.</code></p>