httpMakeParamString()

Returns a string from the passed arguments that represents the query part of a URL.

Synopsis

string httpMakeParamString( dyn_string names, dyn_string values);

Parameter

Parameter Description
names Names for the string.
values Values for the string.

Return value

A string that represents the query part of a URL. In case of errors the function returns a empty string.

Error

Missing or wrong arguments.

Description

Returns a string from the passed arguments that represents the query part of a URL. The query part presents the part of a URL after the question mark:

Query strings are used to transmit options in the URL and are usually decoded into multiple key-value pairs. The one above would contain two entries in its list, with keys "First" (FirstValue) and "second" (secondValue).

#uses "CtrlHTTP"
main()
{
  dyn_string names, values;
  names = makeDynString("first", "second");
  values = makeDynString("firstValue", "secondValue");
  DebugN(httpMakeParamString(names, values));
  /* Returns from the URL the query part.
  =>  "first=first%20value&second=second-value" */
 }

Assignment

CTRL PlugIn

Availability

CTRL, UI