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

  • SEARCH
  • Home
  • 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 8840017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:22:09+00:00 2026-06-14T10:22:09+00:00

I try to read and write a cell in google spreadsheet with http request

  • 0

I try to read and write a cell in google spreadsheet with http request by javascript. The “read” operation works, but the “write” operation fail.
Please help to point out which part I should modify in my code of “write” operation.

The write example I followed is from here https://developers.google.com/google-apps/spreadsheets/,
and it is not working.

My read operation (this is working):

http_request.onreadystatechange = function() {
    process_cellrw(http_request);
};
http_request.open('GET',"https://spreadsheets.google.com/feeds/cells/0Aqed....RHdGc/od6/private/full/R1C1", true);
http_request.setRequestHeader('Authorization','Bearer ' + strAccessToken);
http_request.send(null);

My write operation (this is not working):

var testxml =  ['&lt;entry xmlns="http://www.w3.org/2005/Atom" <br>
    xmlns:gs="http://schemas.google.com/spreadsheets/2006"&gt;',<br>
    '&lt;id>https://spreadsheets.google.com/feeds/cells/0Aqed....RHdGc/od6/private/full/R1C1&lt;/id&gt;',<br>
    '&lt;link rel="edit" type="application/atom+xml"<br> href="https://spreadsheets.google.com/feeds/cells/0Aqed....RHdGc/od6/private/full/R1C2/9zlgi"/&gt;',<br>
    '&lt;gs:cell row="1" col="1" inputValue="xxxx"/&gt;',<br>
    '&lt;/entry&gt;'].join('');<br>

http_request.onreadystatechange = function() {
    process_cellrw();
};

http_request.open('PUT',"https://spreadsheets.google.com/feeds/cells/0Aqed....RHdGc/od6/private/full/R1C2/9zlgi");
http_request.setRequestHeader('Authorization','Bearer ' + strAccessToken);
http_request.setRequestHeader('GData-Version','3.0');
http_request.setRequestHeader('Content-Type', 'application/atom+xml');
http_request.setRequestHeader('If-Match','*');
http_request.setRequestHeader('Content-Length', testxml.length.toString());
http_request.send(testxml);

The write operation always receive http_request.status = 0 at callback function process_cellrw().

My environment is Windows 7 + Chrome browser. I also tested it on Android + Webkit, still fails.

I also tested to add a row by list feed, also fails by receive http_request.status = 0.

  • 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-06-14T10:22:10+00:00Added an answer on June 14, 2026 at 10:22 am

    I found the root cause : cross domain XMLHttpRequest POST/PUT are not support by docs.googole.com and spreadsheets.google.com

    The XMLHttpRequest POST/PUT will first send a HTTP OPTIONS request header to the resource on the other domain, in order to determine whether the actual request is safe to send. But docs.googole.com and preadsheets.google.com always reply “404 Not Found” for this request. That’s why I always received http_request.status = 0 at callback function process_cellrw().

    One solution is to use another CGI which allows cross domain HTTP request, such as PHP.
    Another solution is to implement the write operation with the function UrlFetchApp to send HTTP PUT request in Google Apps Script, and then we can use XMLHttpRequest GET to trigger this Apps Script.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

try to write a composite component that allows mutltiple text inputs. I read that
I try to read and write data from/to Socket with NSStream. Here is my
I need to read/write a string of characters using the IBM-1047 character encoding. But
I tried to work with the boost library to read/write configuration files but I
I am using a modified version of the TaskCloud example to try and read/write
Fail to read/write data to socket when trying to run echo server. No exception
i try to read Data from an Oracle-Database. The problem is that in some
I try to read out all existing calendars. I want have a HashMap with
I try to read out all existing calendars. I tried the example from here:
I try to read a text files with 20x20 data into variable C, and

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.