|
10Duke Enterprise C++ Client
|
#include <AbstractURLCodec.h>
Base implementation of tenduke::net::URLCodec which provides base functionality and can be subclassed to provide specific implementations for the encoding / decoding of URL components.
Public Member Functions | |
| std::string | encodeFormItem (const std::string &value) const override |
Encodes a form item (name or value) for using in application/x-www-form-urlencoded payloads. | |
| std::string | encodeURLPath (const std::string &value) const override |
| Encodes an entire URL path. | |
| std::string | encodeURLQuery (const std::vector< std::pair< std::string, std::string > > &queryParameters) const override |
| Encodes URL query. | |
| std::string | toRequestTarget (const tenduke::net::URL &url) const override |
| std::string | toString (const ::tenduke::net::URL &url) const override |
| Converts the URL to string, URL encoded. | |
Public Member Functions inherited from tenduke::net::URLCodec | |
| virtual std::string | decodeURLComponent (const char *value) const =0 |
| Decodes URL component. | |
| virtual std::string | decodeURLComponent (const char *value, size_t length) const =0 |
| Decodes URL component. | |
| virtual std::string | decodeURLComponent (const std::string &value) const =0 |
| Decodes URL component. | |
| virtual std::string | encodeURLComponent (const std::string &value) const =0 |
| Encodes URL component. | |
| virtual std::string | toRequestTarget (const ::tenduke::net::URL &url) const =0 |
| Returns "request target", i.e., string representation, which is used in an HTTP request message in the request-line (when using the origin-form). | |
|
overridevirtual |
Encodes a form item (name or value) for using in application/x-www-form-urlencoded payloads.
Uses rules from https://url.spec.whatwg.org/#application-x-www-form-urlencoded-percent-encode-set .
| value | the item (name or value) to encode |
Implements tenduke::net::URLCodec.
|
overridevirtual |
Encodes an entire URL path.
Uses rules from https://www.rfc-editor.org/rfc/rfc3986#section-3.3 to encode the path components. Path component cannot contain slashes.
For example ‘"/graph/Profile[id='abc’]/~ManyToOne/Personwould be encoded to /graph/Profile%5Bid=%27abc%27%5D/~ManyToOne/Person`.
| value | the path to encode |
Implements tenduke::net::URLCodec.
|
overridevirtual |
Encodes URL query.
| queryParameters | - |
Implements tenduke::net::URLCodec.
|
overridevirtual |
Converts the URL to string, URL encoded.
| url | URL to convert to string |
Implements tenduke::net::URLCodec.