Error importing a pipeline using Python requests api.
I'm trying to import a pipeline to StreamSets Data Collector. Since the Control hub is enabled I'm getting a cookie token from Control hub for user Authentication.
cookie = token got from control hub.
target_url = "https://Data_Collector_host_name:port_no/rest/v1/pipelines/import"
files = {'file': open("pipelines.zip", 'rb')}
import_response = requests.post(target_url, cookies=cookie, files=files, verify=False)
But it gives an error saying 405: Method not allowed. <title>Error 405 Method Not Allowed</title> </head> <body>
HTTP ERROR 405
Problem accessing /rest/v1/pipelines/import. Reason:
Method Not Allowed