mirror of
https://github.com/recklessop/Zerto_Exporter.git
synced 2026-07-04 16:33:14 -04:00
zvma10 wrapper module
Created a python module that has everything needed for comms with ZVMA version 10 in a seperate class. It does not have full api coverage, but is enough to start refactoring the exporter to use the class for ZVMa10
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import requests
|
||||
from requests import Request, Session
|
||||
|
||||
# Create a Request object
|
||||
url = 'http://httpbin.org/post'
|
||||
headers = {'Content-Type': 'application/json'}
|
||||
data = {'key': 'value'}
|
||||
req = Request('POST', url, data=data, headers=headers)
|
||||
|
||||
# Prepare the request
|
||||
prepared_req = req.prepare()
|
||||
|
||||
# Print the prepared request details
|
||||
print("Prepared Request:")
|
||||
print(f"URL: {prepared_req.url}")
|
||||
print(f"Method: {prepared_req.method}")
|
||||
print(f"Headers: {prepared_req.headers}")
|
||||
print(f"Body: {prepared_req.body}")
|
||||
|
||||
# Send the request using a Session
|
||||
with Session() as s:
|
||||
response = s.send(prepared_req)
|
||||
|
||||
# Print the response
|
||||
print(f"\nResponse Status Code: {response.status_code}")
|
||||
print(response.text)
|
||||
Reference in New Issue
Block a user