You are here

public static function HttpClient::urlencode_rfc3986 in Http Client 7.2

Same name and namespace in other branches
  1. 6.2 includes/HttpClient.inc \HttpClient::urlencode_rfc3986()

Stolen from OAuth_common

1 call to HttpClient::urlencode_rfc3986()
HttpClientRequest::url in includes/HttpClient.inc
Returns the url taken the parameters into account.

File

includes/HttpClient.inc, line 194

Class

HttpClient
A http client.

Code

public static function urlencode_rfc3986($input) {
  if (is_array($input)) {
    return array_map(array(
      'HttpClient',
      'urlencode_rfc3986',
    ), $input);
  }
  else {
    if (is_scalar($input)) {
      return str_replace('+', ' ', str_replace('%7E', '~', rawurlencode($input)));
    }
    else {
      return '';
    }
  }
}