Solved

Post data to a form via Proxy

Posted on 2014-02-26
2
359 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 83

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This script checks a path to see if a folder exists. If the folder does exist you will get output "The folder has previously been created. No action taken" If not it will create the folder. Then adds one user modify permission to the folder. It …
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

776 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