TSUrlHostSet

Traffic Server URL component manipulation API.

Synopsis

#include <ts/ts.h>

TSReturnCode TSUrlHostSet(TSMBuffer bufp, TSMLoc offset, const char* value, int length) InkAPI.cc line 2157
TSReturnCode TSUrlSchemeSet(TSMBuffer bufp, TSMLoc offset, const char* value, int length) InkAPI.cc line 2119
TSReturnCode TSUrlUserSet(TSMBuffer bufp, TSMLoc offset, const char* value, int length) InkAPI.cc line 2133
TSReturnCode TSUrlPasswordSet(TSMBuffer bufp, TSMLoc offset, const char* value, int length) InkAPI.cc line 2145
TSReturnCode TSUrlPortSet(TSMBuffer bufp, TSMLoc offset, int port) InkAPI.cc line 2176
TSReturnCode TSUrlPathSet(TSMBuffer bufp, TSMLoc offset, const char* value, int length) InkAPI.cc line 2201
TSReturnCode TSUrlHttpQuerySet(TSMBuffer bufp, TSMLoc offset, const char* value, int length) InkAPI.cc line 2262
TSReturnCode TSUrlHttpParamsSet(TSMBuffer bufp, TSMLoc offset, const char* value, int length) InkAPI.cc line 2250
TSReturnCode TSUrlHttpFragmentSet(TSMBuffer bufp, TSMLoc offset, const char* value, int length) InkAPI.cc line 2274

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.

TSUrlSchemeSet(), TSUrlUserSet(), TSUrlPasswordSet(), TSUrlHostSet(), TSUrlHttpParamsSet(), TSUrlHttpQuerySet() and TSUrlHttpFragmentSet() each set the specified portion of the URL located at offset within the marshal buffer bufp to the string value. If length is -1 then these functions assume that value is NULL-terminated. Otherwise, the length of the string value is taken to be the value of length. These functions copy the string to within bufp, so it can be subsequently modified or deleted.

TSUrlPortSet() sets the port number portion of the URL located at offset within the marshal buffer bufp to the value port. Normal canonicalization based on the URL scheme still applies.

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), TSUrlStringGet(3ts), TSUrlPercentEncode(3ts)