{ "id": "api/common/http/HttpUrlEncodingCodec", "title": "HttpUrlEncodingCodec", "contents": "\n\n
\n
\n
\n \n API > @angular/common > @angular/common/http\n
\n \n
\n \n
\n

HttpUrlEncodingCodeclink

\n \n \n \n \n \n
\n \n \n\n
\n \n
\n

Provides encoding and decoding of URL parameter and query-string values.

\n\n

See more...

\n
\n \n \n \n
\n\nclass HttpUrlEncodingCodec implements HttpParameterCodec {\n encodeKey(key: string): string\n encodeValue(value: string): string\n decodeKey(key: string): string\n decodeValue(value: string)\n}\n\n\n \n \n\n
\n\n\n \n\n \n \n
\n

Descriptionlink

\n

Serializes and parses URL parameter keys and values to encode and decode them.\nIf you pass URL query parameters without encoding,\nthe query parameters can be misinterpreted at the receiving end.

\n\n \n
\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n
\n

Methodslink

\n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \n\n \n \n
\n
\n

\n encodeKey()\n \n link

\n \n
\n
\n

Encodes a key name for a URL parameter or query-string.

\n\n
\n
\n \n\n encodeKey(key: string): string\n\n \n\n
Parameters
\n \n \n \n \n \n \n \n \n \n
\n \n key\n string\n

The key name.

\n\n
\n\n \n
Returns
\n

string: The encoded key name.

\n\n \n\n\n \n\n \n
\n
\n\n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \n\n \n \n
\n
\n

\n encodeValue()\n \n link

\n \n
\n
\n

Encodes the value of a URL parameter or query-string.

\n\n
\n
\n \n\n encodeValue(value: string): string\n\n \n\n
Parameters
\n \n \n \n \n \n \n \n \n \n
\n \n value\n string\n

The value.

\n\n
\n\n \n
Returns
\n

string: The encoded value.

\n\n \n\n\n \n\n \n
\n
\n\n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \n\n \n \n
\n
\n

\n decodeKey()\n \n link

\n \n
\n
\n

Decodes an encoded URL parameter or query-string key.

\n\n
\n
\n \n\n decodeKey(key: string): string\n\n \n\n
Parameters
\n \n \n \n \n \n \n \n \n \n
\n \n key\n string\n

The encoded key name.

\n\n
\n\n \n
Returns
\n

string: The decoded key name.

\n\n \n\n\n \n\n \n
\n
\n\n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \n\n \n \n
\n
\n

\n decodeValue()\n \n link

\n \n
\n
\n

Decodes an encoded URL parameter or query-string value.

\n\n
\n
\n \n\n decodeValue(value: string)\n\n \n\n
Parameters
\n \n \n \n \n \n \n \n \n \n
\n \n value\n string\n

The encoded value.

\n\n
\n\n \n\n\n \n\n \n
\n
\n\n \n
\n\n\n\n \n\n\n
\n
\n\n\n" }