Send HTTP queries from Vertec using the Python module requests
With the Python requests module, HTTP queries such as GET, POST and PUT can be sent from Vertec.
The module is included with Vertec and is on the Whitelist, so it is not restricted by the Restricted Scripting.
Example from the Vertec xml interface:
import requests url = 'https://firma.vertec-cloud.com/xml' api_token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ODc5ZDQ3OTItZmQxNi00ZWFjLWI5MzUtYT...' headers = {'Authorization': 'Bearer {}'.format(api_token)} xmlquery = """ <Envelope> <Body> <Query> <Selection> <ocl>projektbearbeiter</ocl> </Selection> </Query> </Body> </Envelope> """ response = requests.post(url, headers=headers, data=xmlquery) print(response.text)
The detailed description of the requests module can be found on the developer page: Requests: http for humans.