Reading all the request parameters

Not applicable

Hi,

As we discussed in MBFS work session, we need to know how to read all the incoming request parameters using iterative pattern manner.

For example: We are submitting form which has 10+ form input components. How do we extract these in Apigee side ?

Thanks.

0 1 1,555
1 REPLY 1

I don't know what MBFS means...but....

If the input API request has a dynamic set of query parameters, then you will need some flexible open-ended logic to shred all the query params. Fortunately you have the JavaScript callout policy within Apigee Edge that can do this sort of thing.

Here is a recent answer that may illustrate how to shred query parameters.

The basic logic looks like this;

var queryStringPairs = context.getVariable("request.querystring").split("&");
queryStringPairs.forEach(function(nameValuePair) {
  var nameAndValue = nameValuePair.split('=');
  if (nameAndValue.length == 2) { // is it a name=value form?
      // query param name: nameAndValue[0]
      // query param value: nameAndValue[1]
  }
});

You may want to insert your own logic in that forEach that.... sets context variables, or does other things to the Message context.