Post Method

Welcome Forums General PowerShell Q&A Post Method

Viewing 1 reply thread
  • Author
    • #109835
      Topics: 12
      Replies: 9
      Points: 35
      Rank: Member

      Hi everyone. I want invoke this webseite then pass query

      $test =  Invoke-WebRequest -Uri “”

      $dbForm = $test.Forms[0]

      $dbForm.Fields[“”] =   “[bbox:50.662127,5.9748990,50.857233,6.218150];node [natural = tree];out meta;”


      $r = Invoke-WebRequest -Uri (“”  -$dbForm.Action) -Method Post -Body $dbForm.Fields

      and i write this code but it didn’t work well.

      Any tips will make me glad.


    • #110777
      Topics: 18
      Replies: 4872
      Points: 1,903
      Helping HandTeam Member
      Rank: Community Hero

      That’s unfortunately not how HTTP passes forms; they get passed in the request header. You don’t really need to retrieve the page first, even; you just need to submit a properly formatted request with the form data in the header. It’s not HARD to do with PowerShell, but it’s not super easy, either. And, some servers may – for security reasons – implement additional items, such as cookies, which will make it more complex. You’ll need to understand exactly what the web server expects n

Viewing 1 reply thread
  • The topic ‘Post Method’ is closed to new replies.