I have a Python script that posts a local file to a given URL using requests:
import requests
url = 'https://www.myWebsite.com/ext/ext/ext'
data = "/Users/ME/Documents/folder/folder/folder/test.json"
with open(data) as test:
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
r = requests.post(url, data=test, headers=headers)
I want to do the exact same thing in PowerShell.
I've read this post on User powershell script to post to URL?, but it seems very verbose/involved. Is there any short, easy way to do this? Is there such a thing as a 'requests' equivalent for PowerShell?