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 7698291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:12:27+00:00 2026-05-31T22:12:27+00:00

I’m attempting to integrate my webapp’s calendar with Google Calendar. I’m successfully authenticating the

  • 0

I’m attempting to integrate my webapp’s calendar with Google Calendar. I’m successfully authenticating the user, able to read events from Google and delete events from Google. I’m having trouble updating events from my app to Google.

I’m using the PATCH method described here as I only want to modify the fields that I send in the API call (as opposed to the PUT call which requires all fields for the event).

My Perl code create a JSON object representing what I want to change. I then submit a PATCH request to Google, and I receive status 200 OK and the event resource back from Google. What I receive back is supposed to be the modified event resource, but the fields I have modified are not modified in the response. When I check in Google Calendar itself, once again I see the event is not modified.

I’m confused as to why I’m getting the 200 OK response instead of an error, when the event is not updating. Curiously, in the response, the “updated” timestamp property has been updated, but the summary field has not.

  my $ua = LWP::UserAgent->new;

  my $url = "https://www.googleapis.com/calendar/v3/calendars/primary/events/${id}?access_token=${access_token}";

  my $resource{"summary"} = "$g{summary}";

  $resource = encode_json(\%resource);

  my $headers = HTTP::Headers->new();
  $headers->header(If_Match => "$etag");

  my $request = HTTP::Request->new('PATCH',$url,$headers,$resource);

  my $response = $ua->request($request);

  my $status = $response->status_line;

  my $result = decode_json($response->decoded_content);

The “etag” value from the result is updated as I expect, which indicates that the calendar event is being (somewhat) modified in Google.

Some Data::Dumper tracing:

The request:

$VAR1 = bless( {
                 '_content' => '{"summary":"End of season function MODIFIED"}',
                 '_uri' => bless( do{\(my $o = 'https://www.googleapis.com/calendar/v3/calendars/primary/events/<eventID>?access_token=<access_token>')}, 'URI::https' ),
                 '_headers' => bless( {
                                        'if-match' => '<etag>'
                                      }, 'HTTP::Headers' ),
                 '_method' => 'PATCH'
               }, 'HTTP::Request' );

The response:

$VAR1 = bless( {
                 '_protocol' => 'HTTP/1.1',
                 '_content' => '{
 "kind": "calendar#event",
 "etag": "<etag>",
 "id": "<eventID>",
 "status": "confirmed",
 "htmlLink": "<suppressed>",
 "created": "2012-03-08T05:06:04.000Z",
 "updated": "2012-03-25T09:18:49.000Z",
 "summary": "End of season function",
 "creator": {
  "email": "<suppressed>"
 },
 "organizer": {
  "email": "<suppressed>"
 },
 "start": {
  "date": "2012-03-24"
 },
 "end": {
  "date": "2012-03-24"
 },
 "iCalUID": "<suppressed>",
 "sequence": 1,
 "reminders": {
  "useDefault": true
 }
}
',
                 '_rc' => '200',
                 '_headers' => bless( {
                                        'connection' => 'close',
                                        'cache-control' => 'no-cache, no-store, max-age=0, must-revalidate',
                                        'date' => 'Sun, 25 Mar 2012 09:18:49 GMT',
                                        'client-ssl-cert-issuer' => '/C=US/O=Google Inc/CN=Google Internet Authority',
                                        'client-ssl-cipher' => 'ECDHE-RSA-RC4-SHA',
                                        'client-peer' => '173.194.72.95:443',
                                        'client-date' => 'Sun, 25 Mar 2012 09:18:49 GMT',
                                        'pragma' => 'no-cache',
                                        'content-type' => 'application/json; charset=UTF-8',
                                        'x-xss-protection' => '1; mode=block',
                                        'server' => 'GSE',
                                        'client-ssl-socket-class' => 'IO::Socket::SSL',
                                        'client-response-num' => 1,
                                        'etag' => '<etag>',
                                        'x-frame-options' => 'SAMEORIGIN',
                                        'x-content-type-options' => 'nosniff',
                                        'client-ssl-cert-subject' => '/C=US/ST=California/L=Mountain View/O=Google Inc/CN=*.googleapis.com',
                                        'expires' => 'Fri, 01 Jan 1990 00:00:00 GMT'
                                      }, 'HTTP::Headers' ),
                 '_msg' => 'OK',
                 '_request' => bless( {
                                        '_content' => '{"summary":"End of season function MODIFIED"}',
                                        '_uri' => bless( do{\(my $o = 'https://www.googleapis.com/calendar/v3/calendars/primary/events/<eventID>?access_token=<access_token>')}, 'URI::https' ),
                                        '_headers' => bless( {
                                                               'user-agent' => 'libwww-perl/6.01',
                                                               'if-match' => '<etag>'
                                                             }, 'HTTP::Headers' ),
                                        '_method' => 'PATCH',
                                        '_uri_canonical' => $VAR1->{'_request'}{'_uri'}
                                      }, 'HTTP::Request' )
               }, 'HTTP::Response' );

Can anyone see what I’m doing wrong? I’m sure that Google is accepting my PATCH request, but for some reason not exactly seeing the field I want to modify. I’ve tried submitting the exact same JSON object on their testing page and have no problem getting that to work…

  • 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-31T22:12:28+00:00Added an answer on May 31, 2026 at 10:12 pm

    I found the solution purely by trial and error – adding the “Content-Type” header to the HTTP header seemed to do the trick:

      my $headers = HTTP::Headers->new();
      $headers->header(If_Match => "$etag");
      $headers->header(Content_Type => "application/json");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I need to clean up various Word 'smart' characters in user input, including but
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am currently running into a problem where an element is coming back from

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.