Calender event is getting update using python request and response but CURL can not able to do so using groovy
Python scripts which is working-
import requests
import json
baseURL = 'https://confluence.mycomp.com/rest/calendar-services/1.0/calendar/events.json'
headers = { "content-type" : "application/x-www-form-urlencoded" }
user='****'
password='****'
hd={'Content-Type': 'application/json'}
calenderData = {"subCalendarId":"7ed3840a-*******-","eventType":"Events", "what":"CTEF1 Test Deployment", "person": ["*********"],"startDate":"28-Apr-2020","endDate": "28-Apr-2020","allDayEvent": "true","where": "By DVM PipeLine" }
response = requests.put(baseURL, headers=headers, auth=(user, password), data=calenderData, timeout=15)
print('\n\n\n')
print(response.content)
Groovy curls which is not working :-( It is showing null event)
baseURL = 'https://confluence.mycomp.com/rest/calendar-services/1.0/calendar/events.json'
user='****'
password='****'
calenderData = {"subCalendarId":"7ed3840a-6e3e-4043-******","eventType":"Events", "what":"CTEF1 Test Deployment", "person": ["********"],"startDate":"28-Apr-2020","endDate": "28-Apr-2020","allDayEvent": "true","where": "By DVM PipeLine" }
def response = ["curl", "-k", "-u", "user:passwords", "-X", "PUT", "-d", "${calenderData}", "-H", "Content-Type:application/json", "${baseURL}"].execute().text
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.