Request parameters, headers and cookies

MCS handles request parameters like the related HTTP methods.

MCS handles request parameters like the related HTTP methods.

The webd:get appends all specified parameters to the end of the URL, and webd:post will pass the parameters in the request headers. The webd:parameters element may occur only once, and contains multiple webd:parameter elements that allow parameters to be created or copied.

You identify new parameters with the webd:name element and pair it with a webd:value. If the same parameter name is used more than once, a multi-value parameter will be created.

Note:

All the elements that take parameters may be used in either element mode or attribute mode. If you need to pass a pipeline expression in a parameter you should use attribute mode.

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/2002/06/xhtml2"
  xmlns:pipeline="http://www.volantis.com/xmlns/marlin-pipeline"
  xmlns:webd="http://www.volantis.com/xmlns/marlin-web-driver">
  <head>
    <title>DCI elements</title>
  </head>
  <body>
    <div>
      <pipeline:transform href="test.xsl">
        <webd:get url="http://weather.yahooapis.com/forecastrss">
          <webd:parameters>
            <webd:parameter name="p" value="USWA0395"/>
            <webd:parameter name="u" value="c"/>
          </webd:parameters>
        </webd:get>
      </pipeline:transform>
    </div>
  </body>
</html>

Parameters are copied using the from element to identify the source, and the name to give the new name.

Request headers

Unlike parameters, there is no difference in how request headers are handled for the two different types of request. The webd:headers element, contains multiple webd:header elements.

New headers are created in the same way as parameters, with name/value pairs. If the same header name is used more than once, the last specified value will be used for the header.

<webd:headers>
  <webd:header>
    <webd:name>User-Agent</name>;
    <webd:value>Nokia5210/1.0</value>
  </webd:header>
</webd:headers>

Copying also follows the pattern.

<webd:headers>
    <webd:header from="Accept" name="New-Accept"/>
</webd:headers>

Specifying cookies

The cookie is used in the same way as the header. However the cookie element has additional elements or attributes that you can use to validate the cookie against the domain, path, and age of the cookie, and the protocol of the request.

<webd:cookies>
  <webd:cookie name="user" 
    domain="www.somesite.com" 
    path="/login" 
    maxage="100" 
    secure="true" 
    value="TolkiensPage"/>
  <webd:cookie>
    <name>location</name>
    <domain>www.anywhere.com</domain>
    <path>/login</path>
    <maxage>100</maxage>;
    <secure>true</secure>
    <value>UK</value>
  </webd:cookie>
</webd:cookies>

Related topics