Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

How to use Invoke-webrequest with many parameters in Header and body?

$
0
0

Hi,

I have fetch from fiddler a request message. I am trying to send the message using Powershell command "Invoke-webrequest". I have tried to put all the Headers in one hash-table and all the body in second Hash-table like this:

Invoke-WebRequest -Method post -Uri http://someIP/backoffice/test.aspx?Submit=SaveConference&AFolderID=234234999&HostAccountID=73 -Headers $HeaderParams -Body $postparams

But it doesn't work. i get 200 OK but i do not see real results. Am i on the correct way about the request?

Here is the request message as taken from Fiddler:

POST http://someIP/backoffice/test.aspx?Submit=SaveConference&AFolderID=234234999&HostAccountID=73 HTTP/1.1

Host: someIP

Connection: keep-alive

Content-Length: 806

Cache-Control: max-age=0

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8

Origin: http://someIP

User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36

Content-Type: application/x-www-form-urlencoded

Referer: http://someIP/backoffice/test.aspx?AFolderID=234234999&HostAccountID=73

Accept-Encoding: gzip, deflate

Accept-Language: he-IL,he;q=0.8,en-US;q=0.6,en;q=0.4

Cookie: ASP.NET_SessionId=qz4geenpga3yspyeej0uagte

 

VaccId=roy&ACC+FQDN=scrmacc.connectrnd.com&FolderId=234234999&AccessCodeType=0&Title=testing&StartTime_Date=2015-06-28&StartTime_Time=15%3A24&Duration=30&Seats=15&CallerPaidHost=&CallerPaid=&TollFreeHost=&TollFree=&AttDirectTollFreeHost=&AttDirectTollFree=&HostPassword=1234567&HostFirstName=&HostMiddleInitial=&HostLastName=&HostEmail=&HostAccessCode=1234567&PartAccessCode=1234567&CoHostAccessCode=0&CoHostPassword=7654321&AllowTroubleReporting=False&Ecm=3&HostLeadTime=30&ParticipantLeadTime=15&AutoStart=True&AutoStartMinutes=5&GlobalAccessUrl=&PreferredCountry=Uzbekistan&BroadcastAllow=True&BroadcastOn=False&ConfRecordAllow=True&ConfRecordOn=False&DialAllow=True&TonesAllow=True&TonesOn=False&AttcConfId=&ConfKey=&PartListShow=True&Submit=SaveConference

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles