|
@@ -30,6 +30,22 @@
|
|
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ Returns a percent-escaped string following RFC 3986 for a query string key or value.
|
|
|
|
+ RFC 3986 states that the following characters are "reserved" characters.
|
|
|
|
+ - General Delimiters: ":", "#", "[", "]", "@", "?", "/"
|
|
|
|
+ - Sub-Delimiters: "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "="
|
|
|
|
+
|
|
|
|
+ In RFC 3986 - Section 3.4, it states that the "?" and "/" characters should not be escaped to allow
|
|
|
|
+ query strings to include a URL. Therefore, all "reserved" characters with the exception of "?" and "/"
|
|
|
|
+ should be percent-escaped in the query string.
|
|
|
|
+
|
|
|
|
+ @param string The string to be percent-escaped.
|
|
|
|
+
|
|
|
|
+ @return The percent-escaped string.
|
|
|
|
+ */
|
|
|
|
+FOUNDATION_EXPORT NSString * AFPercentEscapedStringFromString(NSString *string);
|
|
|
|
+
|
|
/**
|
|
/**
|
|
A helper method to generate encoded url query parameters for appending to the end of a URL.
|
|
A helper method to generate encoded url query parameters for appending to the end of a URL.
|
|
|
|
|