Skip to content

Instantly share code, notes, and snippets.

@hoangitk
Created October 27, 2021 10:08
Show Gist options
  • Save hoangitk/bbed4152ba3a8f73cfccc1cc47c37218 to your computer and use it in GitHub Desktop.
Save hoangitk/bbed4152ba3a8f73cfccc1cc47c37218 to your computer and use it in GitHub Desktop.
[curl in Powershell] #powershell

curl in Powershell

https://www.educative.io/edpresso/curl-in-powershell


  1. Make a web request to the educative website:
 Invoke-WebRequest -URI https://www.educative.io/
  1. Get all links on a webpage:
 (Invoke-WebRequest -Uri "https://www.educative.io/").Links.Href
  1. Submit form-data:
 $Form = @{    
 	firstName  = 'Bruce'    
    lastName   = 'Wayne'    
    email      = '[email protected]'    
    occupation = 'Superhero' 
    } 
$Result = Invoke-WebRequest -Uri [sample-url] -Method Post -Form $Form

Similarly, you can run more curl commands using Invoke-WebRequest.

Read more about Invoke-WebRequest here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment