Solved

Post data to a form via Proxy

Posted on 2014-02-26
2
341 Views
Last Modified: 2014-02-26
I want to be able to submit a webform with some values, however my simple code just says:-

Invoke-WebRequest : This operation is not supported for a relative URI.
At D:\Desktop\Post Data - Invoke.ps1:2 char:9
+ $test = Invoke-WebRequest -Uri http://http://localhost/TestForm.php -Method POST ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Invoke-WebRequest], InvalidOperationException
    + FullyQualifiedErrorId : System.InvalidOperationException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand




My code is quite simple, and dont see why it should not work:-
$postParams = @{username='me';moredata='qwerty'}
$test = Invoke-WebRequest -Uri http://http://localhost/TestForm.php -Method POST -Body $postParams -Proxy '192.168.1.120:3128'

Open in new window


Any ideas?

Thank you
0
Comment
Question by:tonelm54
2 Comments
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39888184
You've 'http://' in there twice.  http://http:// makes it an invalid URL.
0
 

Author Comment

by:tonelm54
ID: 39888616
DOH!!!!
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Join & Write a Comment

Suggested Solutions

Hi all.   The other day I had to change the passwords for a bunch of users on the fly. Because they were so many, I decided to do it in an automated way and I would like to share it with you all.   If you are not doing it directly in a Domain Co…
Utilizing an array to gracefully append to a list of EmailAddresses
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now