Forum Discussion

strongarm_46960's avatar
strongarm_46960
Icon for Nimbostratus rankNimbostratus
Feb 22, 2008

post form xml wrapped payload

 

 

the form below is located on server http://192.168.1.1/form.html

 

---

 

> METHOD=POST ACTION="mycgiscript ">

 

Username:

 

Password:

 

TYPE="SUBMIT" VALUE="Login">

 

 

---

 

 

once the user hits submit, I need my irule to put an xml tag ( around the USERNAME, and also put another xml tag around the entered password value.

 

---

 

 

 

 

thus, after submition, the body submitted should contain

 

 

USERNAME=Iamgood&password=letmein&login-form-type=pwd

 

 

 

1 Reply

  • Hi,

     

     

    To do your job you'll need to intercept the request when it is sent.

     

     

    Since it's a post method you'll need to check the payload of the request.

     

     

    To do so you'll need to use the HTTP::collect and HTTP::payload to do the job.

     

     

    Then you'll need to find where in the payload is located the string username=***** and the other one. to do so you should check the regexp command with the option -indices.

     

     

    To update the content you can use the command HTTP::payload replace.

     

     

    You should check the wikis and this forum for some examples.

     

     

    HTH