diff --git a/CI/check_twin_pipelines.py b/CI/check_twin_pipelines.py
index e32f14d196792a0103b54b22577e0eaef3950c69..d2a6113924677266de8cf30f8d35debc8ee2c3ea 100644
--- a/CI/check_twin_pipelines.py
+++ b/CI/check_twin_pipelines.py
@@ -28,14 +28,19 @@ import time
 """
 Send a request to Gitlab and return the answer
 The request parameter is added after `project/:id/`
+WARNING: when data is given, the request will be a POST
+Otherwise, it is a GET
 """
-def GitlabRequest(request, project=53, token=''):
+def GitlabRequest(request, project=53, data=None, token=''):
   gitlab_url = "https://gitlab.orfeo-toolbox.org/api/v4/projects/"
   gitlab_url+= str(project) + '/' + request
+  params = None
   myHeader = {}
+  if not data is None:
+    params = urllib.parse.urlencode(data).encode('ascii')
   if token:
     myHeader = {'PRIVATE-TOKEN':token}
-  gitlab_request = urllib.request.Request(gitlab_url,headers=myHeader)
+  gitlab_request = urllib.request.Request(gitlab_url, data=params, headers=myHeader)
   res = urllib.request.urlopen(gitlab_request)
   return json.loads(res.read().decode())
 
@@ -67,7 +72,7 @@ if __name__ == "__main__":
     if wip_regex.search(mrInfo["title"]):
       # Yes: cancel the current pipeline
       print("Cancel current pipeline "+env['CI_PIPELINE_ID'])
-      GitlabRequest('pipelines/'+env['CI_PIPELINE_ID']+'/cancel', \
+      GitlabRequest('pipelines/'+env['CI_PIPELINE_ID']+'/cancel', data={}, \
         project=env['CI_PROJECT_ID'], token=env['K8S_SECRET_TWIN_PIPELINE'])
       time.sleep(180)
       print("Error: this pipeline should have been canceled")
@@ -78,6 +83,6 @@ if __name__ == "__main__":
       for item in jres:
         if item["id"] < int(env['CI_PIPELINE_ID']) and item["status"] == "running":
           print("Cancel pipeline "+str(item["id"]))
-          jres2 = GitlabRequest('pipelines/'+str(item["id"])+'/cancel', \
+          jres2 = GitlabRequest('pipelines/'+str(item["id"])+'/cancel', data={}, \
             project=env['CI_PROJECT_ID'], token=env['K8S_SECRET_TWIN_PIPELINE'])