# HTTP post fields

**URL:** <https://community.f5.com/t/http-post-fields/34596>\
**Category:** Technical Forums\
**Tags:** dev, irules, devops, application-delivery\
**Created:** [October 24, 2005, 4:14pm UTC](https://community.f5.com/t/http-post-fields/34596 "2005-10-24T16:14:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kapil\_Sharma\_61](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@Kapil\_Sharma\_61](https://community.f5.com/u/Kapil_Sharma_61)\
**Post date:** [October 24, 2005, 4:14pm UTC](https://community.f5.com/t/http-post-fields/34596/1 "2005-10-24T16:14:06Z")

</div>

Hi,

Is there any way to get the HTTP POST hidden fields using irules and then send the information to the backend servers?

Thanks,

kapil

---

<div class="post-metadata">

**Author:** ![bl0ndie\_127134](https://avatars.discourse-cdn.com/v4/letter/b/0ea827/32.png) [@bl0ndie\_127134](https://community.f5.com/u/bl0ndie_127134)\
**Post date:** [October 24, 2005, 4:50pm UTC](https://community.f5.com/t/http-post-fields/34596/2 "2005-10-24T16:50:08Z")

</div>

We have been talking about adding a feature to make POST field extraction a little bit easier but for now you will have to do an HTTP::collect and use the HTTP::payload command to access and parse the data.

---

<div class="post-metadata">

**Author:** ![Kapil\_Sharma\_61](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@Kapil\_Sharma\_61](https://community.f5.com/u/Kapil_Sharma_61)\
**Post date:** [October 26, 2005, 12:00pm UTC](https://community.f5.com/t/http-post-fields/34596/3 "2005-10-26T12:00:58Z")

</div>

Thanks for your reply. Let me explain our existing rules and what I am trying to achieve:

Existing rules:

-------------------------

when HTTP\_REQUEST {

if { [active\_members servpool1] == 1 } {

log “pool1 is up”

set uri [HTTP::uri]

log “the initial http uri is: $uri”

if { $uri starts\_with “/logon\.mic” } {

set new\_uri [string replace $uri 0 10 /mic/SignIn.mic]

HTTP::uri “$new\_uri”

pool servpool1

log “The replaced URL is: $new\_uri”

}

elseif { $uri starts\_with “/ea/” } {

set new\_uri [string range $uri 3 end]

log “the new URI is: $new\_uri”

HTTP::uri “$new\_uri”

pool servpool1

log “the new HTTPURI is $new\_uri”

}

}

This is what we want to achieve:

1: We want to retrive a post field named “data” from the initial request from the client

2: then set the new\_uri variable to :

set new\_uri [string replace $uri 0 10 /mic/SignIn.mic?data=$data]

where $data is the post field retrieved from the client request.

How can we do that?

Thanks,

Kapil

---

<div class="post-metadata">

**Author:** ![unRuleY\_95363](https://avatars.discourse-cdn.com/v4/letter/u/58f4c7/32.png) [@unRuleY\_95363](https://community.f5.com/u/unRuleY_95363)\
**Post date:** [November 1, 2005, 9:36pm UTC](https://community.f5.com/t/http-post-fields/34596/4 "2005-11-01T21:36:34Z")

</div>

You would need to run HTTP::collect when you detect that you are dealing with the form. Then in the HTTP\_REQUEST\_DATA event, you need to search for the field and can then rewrite the uri to include the data. Try searching for collect and HTTP\_REQUEST\_DATA to see some examples of collecting HTTP payload.
