Scroll to navigation

TSURLPERCENTENCODE(3ts) Apache Traffic Server TSURLPERCENTENCODE(3ts)

NAME

TSUrlPercentEncode - traffic Server URL percent encoding API

SYNOPSIS

#include <ts/ts.h>




DESCRIPTION

The URL data structure is a parsed version of a standard internet URL. The Traffic Server URL API provides access to URL data stored in marshal buffers. The URL functions can create, copy, retrieve or delete entire URLs, and retrieve or modify parts of URLs, such as their host, port or scheme information.

TSUrlPercentEncode() performs percent-encoding of the URL object, storing the new string in the dst buffer. The length parameter will be set to the new (encoded) string length, or 0 if the encoding failed. TSStringPercentEncode() is similar but operates on a string. If the optional map parameter is provided (not NULL) , it should be a map of characters to encode.

TSStringPercentDecode() perform percent-decoding of the string in the str buffer, writing to the dst buffer. The source and destination can be the same, in which case they overwrite. The decoded string is always guaranteed to be no longer than the source string.

RETURN VALUES

All these APIs returns a TSReturnCode, indicating success (TS_SUCCESS) or failure (TS_ERROR) of the operation.

SEE ALSO

TSAPI(3ts), TSUrlCreate(3ts), TSUrlHostGet(3ts), TSUrlHostSet(3ts), TSUrlStringGet(3ts)

COPYRIGHT

2022, dev@trafficserver.apache.org

May 21, 2022 8.1