Hi Booth
1)Yes if they are more than one parameters you have to name them and
they can be in any order.
Please find little summary i found about the IWS parameters
*Whether to wrap input parameters*: Specify whether to wrap all input
parameters in a structure or not.
The decision whether to wrap or not wrap input parameters is a based on
whether you have more than
one input parameter and whether or not you are planning on injecting a
value in one of the input
parameters.
– If you choose to wrap input parameters, then all input parameters will be
wrapped in a structure, the
injection of values into parameters is not allowed, the HTTP method for the
resource must be POST or
PUT, and the HTTP requests must have a structured messages payload with
type XML or JSON.
– If you choose to not wrap input parameters, then there can only be at
most one parameter that is not
injected with a value from an input source. This option is not allowed if
there exists input parameters
that are arrays, or more than one parameter that is a structure, or there
is a primitive input parameter
that has a type other than "int", "char", "byte", "float", "packed" or
"zoned".
Only parameters that have a primitive type may be injected with a value
from an input source. You
can inject input parameters with values from the following input sources:
- *QUERY_PARAM: The value is retrieved from a query parameter extracted
from the request URL.
Query parameters are appended to the URL after a "?" with name-value pairs.
For instance, if the
URL is
http://example.com/collection?itemID=itemIDValue, the query
parameter name
is itemID and itemIDValue is the value. Query parameters are often used
when filtering or
paging through HTTP GET requests.
- *PATH_PARAM: The value is retrieved from the URI path parameter extracted
from the request URI.
Path parameters are part of the URL. For example, the URI path template can
include /
collection/{item}, where {item} is a path parameter that identifies the
item. If there are no
parameters set in the URI path templates, you will not be allowed to
specify *PATH_PARAM as an
input source.
- *FORM_PARAM: The value is retrieved from a HTML form parameter extracted
from HTML form
elements. Form parameters are used when submitting a HTML form from a
browser with a media
type of application/x-www-form-urlencoded. The form parameters and values
are encoded
in the request message body in the form like the following:
firstParameter=firstValue&secondParameter=secondValue. In order for you to
specify
*FORM_PARAM as an input source, the HTTP request method must be set to PUT
or POST.
- *COOKIE_PARAM: The value is extracted from the HTTP cookie value in the
incoming HTTP request.
Cookie parameters are special HTTP headers. While cookies are associated
with storing session
identification or stateful data that is not accepted as RESTful, cookies
can contain stateless
information.
- *HEADER_PARAM: The value is extracted from the HTTP header value in the
incoming HTTP
request. Headers often contain control metadata information for the client,
intermediary, or server.
- *MATRIX_PARAM: The value is retrieved from the URI matrix parameter.
Matrix parameters are part
of the URL. For example, if the URL includes the path segment, /
Thanks
Anshul
On Sun, Aug 11, 2019 at 2:10 PM Booth Martin <booth@xxxxxxxxxxxx> wrote:
Let me repeat this back to you.
"parm1/aaa/parm2/bbb/parm3/ccc/parm4/ddd" ??
The parms do not have to be in order, since they are named?
I have to name the parm if there is more than 1?
On 8/11/2019 6:52 AM, anshul narang wrote:
Hello Booth
It all depends upon the requirement . Some people like in query string(
followed by ?) or some like Path Parm ( / ).
Query string -www.iseries.com?parm1=value&parm2=value&parm3=value
Path parm -www.iseries.com/parm1/value/parm2/value/parm3/value
...
Hope it makes sense
Thanks
Anshul
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
list
To post a message email: WEB400@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/web400.
As an Amazon Associate we earn from qualifying purchases.