- This topic has 1 reply, 2 voices, and was last updated 4 months, 2 weeks ago by
May 4, 2020 at 9:55 pm #225468ParticipantTopics: 4Replies: 6Points: 59Rank: Member
I have a project to run a cmdlet whether on a server or workstation to get the list of updates which includes the description of the update, date/time installed, so I went ahead and used Get-WUHistory and it did showed me the results I wanted.
Here’s my issue, my boss wanted me to send/export the results instead of saving it to a file, he wants me to send the results to one of our websites. I used the cmdlet
Invoke-WebRequest -Uri https://<domain> -Method POST
But I talked to one of the developer of the website and told me to include the ff:
I run the following cmdlet below:
And I’m getting a Bad Request (400) error so I’m not sure if I’m doing the proper way in doing POST
May 5, 2020 at 4:02 am #225546ParticipantTopics: 0Replies: 37Points: 371Rank: Contributor
Looks like you need to get more information from your API developer and use tools like Postman or any addons for your browser to debug/test your API requests. For example Resting for Mozilla:
From your post it appears that you need to provide auth token to your API(in headers or in query) and POST your Get-WUHistory output int the request body.
Hope that helps.
- The topic ‘Invoke-WebRequest -Method POST’ is closed to new replies.