Accessing POSTed form param from policy

Not applicable

I'm having some issues retrieving a form parameter in an AssignMessage policy.

The API is called via a POST request, which has a plain-text body consisting of:

sid=12345678

With the following policy (first policy in the pre-flow), all variables are unresolved.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage name="assign_config_variables">
  <AssignVariable>
    <Name>sid</Name>
    <Ref>request.formparam.sid</Ref>
    <Value>unknown</Value>
  </AssignVariable>
  <AssignVariable>
    <Name>formparam</Name>
    <Ref>request.formparam</Ref>
    <Value>unknown</Value>
  </AssignVariable>
  <AssignVariable>
    <Name>formstring</Name>
    <Ref>request.formstring</Ref>
    <Value>unknown</Value>
  </AssignVariable>
</AssignMessage>

How would I retrieve/use the value of 'sid' in a policy or condition?

Solved Solved
0 3 1,927
2 ACCEPTED SOLUTIONS

Not applicable

Please set the content-type as application/x-www-form-urlencoded.

View solution in original post

Not applicable

Use this and try to extract form params remember content-ype should be application/x-www-form-urlencoded.

<AssignVariable> <Name>sid</Name> <Ref>request.formparam.sid</Ref> <Value>unknown</Value> </AssignVariable>

View solution in original post

3 REPLIES 3

Not applicable
 <AssignVariable>
    <Name>formparam</Name>
    <Ref>request.formparam</Ref>
    <Value>unknown</Value>
  </AssignVariable>
  <AssignVariable>
    <Name>formstring</Name>
    <Ref>request.formstring</Ref>
    <Value>unknown</Value>
  </AssignVariable>

can you remove the above and try....you altering formparam in above assign varaible.

Not applicable

Please set the content-type as application/x-www-form-urlencoded.

Not applicable

Use this and try to extract form params remember content-ype should be application/x-www-form-urlencoded.

<AssignVariable> <Name>sid</Name> <Ref>request.formparam.sid</Ref> <Value>unknown</Value> </AssignVariable>