1.

Solve : How to send a HTTP request within a batch file??

Answer»

Any help would be much appreciated!
- On SERVER 1, I have a batch file to build a HTTP request, like: http://SERVER2ADDRESS:PORT/SessionControl/CCXML10.start?tokenid=MYCCXMLAPP
- Within the batch file, what command to use to acutally send the HTTP request such that it will be opened on SERVER 2?Can a browser make the request?
Run Internet Explorer From Command Prompt Can you use Powershell?  It can do reasonably sophisticated web transactions.Rob Pomero, good idea. Here is one on many such tips for PowerShel.

Quote

Get-Web (Another round of wget for PowerShell)
By Joel 'Jaykul' BENNETT on 01-May-2008

Well, after multiple attempts at a wget PowerShell script (the last one works very well for downloading web pages, files, as long as you don’t need to send post parameters or anything like that) ... I found myself writing a script last week that included a custom HTTP POST function as well as using some prior functionality I wrote (ConvertFrom-Html) to convert HTML files to XML documents — which PowerShell can deal with NICELY.
Forgot the link.
http://huddledmasses.org/get-web-another-round-of-wget-for-powershell/Some sample CODE:

Code: [Select]# WebClient object, for querying a web server through a proxy server with POST data
$wc = new-Object System.Net.WebClient
$proxy = New-Object System.Net.WebProxy('proxy.local', '8080')
$proxy.BypassList = 'someserver.local'
$wc.proxy = $proxy
$post_vars = new-object System.Collections.Specialized.NameValueCollection

# Download a PAGE
$startpage = $wc.DownloadString("http://wherever.com")

$post_vars.Add('variable1','value1')
$post_vars.Add('variable2',$value2)
$endpage = $wc.UploadValues('http://wherever.com/upload', 'POST', $post_vars)

# For debugging:
$response = [System.Text.Encoding]::ASCII.GetString($endpage)
Write-Host $response


Discussion

No Comment Found