

InterviewSolution
Saved Bookmarks
1. |
Solve : How to send a HTTP request within a batch file?? |
Answer» Any help would be much appreciated! Get-Web (Another round of wget for PowerShell)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 |
|