@param UriInterface     $requestUri
@param EncoderInterface $encoder

@return ResponsesInterface
554335
protected static function defaultCreateResponses(
        UriInterface $requestUri,
        EncoderInterface $encoder
    ): ResponsesInterface {
        $encoder->forOriginalUri($requestUri);
        $responses = new Responses(
            new MediaType(MediaTypeInterface::JSON_API_TYPE, MediaTypeInterface::JSON_API_SUB_TYPE),
            $encoder
        );

        return $responses;
    }
1206137
public function write_handshake_request(AvroIOBinaryEncoder $encoder)
  {
    if ($this->transceiver->is_connected())
      return;
    
    $remote_name = $this->transceiver->remote_name();
    
    $local_hash = $this->local_protocol->md5();
    $remote_hash = (!isset($this->remote_hash[$remote_name])) ? null : $this->remote_hash[$remote_name];
    if (is_null($remote_hash)) {
      $remote_hash = $local_hash;
      $this->remote = $this->local_protocol;
    } else {
      $this->remote = $this->remote_protocol[$remote_name];
    }
    
    $request_datum = array('clientHash' => $local_hash, 'serverHash' => $remote_hash, 'meta' => null);
    $request_datum["clientProtocol"] = ($this->send_protocol) ? $this->local_protocol->__toString() : null;
    
    $this->handshake_requestor_writer->write($request_datum, $encoder);
  }
769893
public final HttpClient cookieCodec(ClientCookieEncoder encoder) {
		ClientCookieDecoder decoder = encoder == ClientCookieEncoder.LAX ?
				ClientCookieDecoder.LAX : ClientCookieDecoder.STRICT;
		return cookieCodec(encoder, decoder);
	}
64467
function full_uri_encode(string) {
  string = encodeURIComponent(string);
  string = string.replace(/\./g, '%2E');
  return(string);
}
295187
private HttpUriRequest makeRequest(URI uri, final String requestBody)
    {
        HttpPost post = new HttpPost(uri);
        post.setEntity(new StringEntity(requestBody, m_contentType));
        return post;
    }
722162
protected function makeRequest($requestType, $uri)
    {
        $this->crawler = $this->client()->request('GET', $uri);

        $this->clearInputs()->assertPageLoaded($uri);

        return $this;
    }
1358780
public static String encodeClientURI(String uri) {
        if (uri == null) {
            return Constants.URI_CLIENT_PREFIX;
        }
        return Constants.URI_CLIENT_PREFIX + uri;
    }
96395
public static function getResponseFromDataUri($dataUri)
    {
        $mimeType = substr($dataUri, 5, strpos($dataUri, ';') - 5);
        $content = base64_decode(substr($dataUri, strpos($dataUri, ',') + 1));

        return new Response($content, Response::HTTP_OK, [
            'Content-Type' => $mimeType,
        ]);
    }
599309
public function process(
        ServerRequestInterface $p_request,
        RequestHandlerInterface $p_handler
    ): ResponseInterface {
        try {
            if ($this->checkRequest($p_request)) {
                return $this->encodeResponse(
                    $p_handler->handle(
                        $this->decodeRequest($p_request)
                    )
                );
            } else {
                if ($this->override) {
                    return $p_handler->handle($p_request);
                }
            }
        } catch (\Exception $ex) {
            return $this->createErrorResponse($ex);
        }
        return $this->createUnsupportedRequestResponse();
    }
1183548
public function redirect($uri, int $code = 302): ResponseInterface
    {
        if (!is_string($uri) && !$uri instanceof UriInterface) {
            throw new ResponseException("Redirect allowed only for string or UriInterface uris");
        }

        return $this->responseFactory->createResponse($code)->withHeader("Location", (string)$uri);
    }
517274
protected function resolution(UriInterface $referenceUri)
    {
        $key = $referenceUri->toString();
        if (array_key_exists($key, $this->resolutions)) {
            return $this->resolutions[$key];
        }

        return null;
    }
642312
function requestURI( $uri )
    {
        $parsed = parse_url( $uri );

        $return = '';
        if ( isset( $parsed['user'] ) )
        {
            $return .= $parsed['user'] . '@' . $parsed['pass'];
        }
        $params = ( $this->Verb == 'GET' || $this->Verb == 'HEAD' || $this->Verb == 'TRACE' ) ? $this->Parameters : array();
        if ( $this->NameVar == null )
        {
            $return .= rtrim( $parsed['path'], '/' ) . '/' . ltrim( $this->Name, '/' );
        }
        else
        {
            $return .= $parsed['path'];
            if ( $this->Verb == 'GET' || $this->Verb == 'HEAD' )
            {
                $params[$this->NameVar] = $this->Name;
            }
        }

        if ( isset( $parsed['query'] ) )
        {
            $return  .= '?' . $parsed['query'];
            $next = '&';
        }
        else
        {
            $next = '?';
        }
        if ( count( $params ) )
        {
            $return .= $next . $this->_payload( $params );
        }
        if ( isset( $parsed['fragment'] ) )
        {
            $return .= '#' . $parsed['fragment'];
        }

        return $return;
    }
408511
public function setRequestUri(string $requestUri) : Request
    {
        $pos = strpos($requestUri, '?');

        if ($pos === false) {
            $this->path = $requestUri;
            $this->queryString = '';
            $this->query = [];
        } else {
            $this->path        = substr($requestUri, 0, $pos);
            $this->queryString = substr($requestUri, $pos + 1);

            if ($this->queryString === '') {
                $this->query = [];
            } else {
                parse_str($this->queryString, $this->query);
            }
        }

        $this->requestUri = $requestUri;

        return $this;
    }
342502
public final HttpClient cookieCodec(ClientCookieEncoder encoder, ClientCookieDecoder decoder) {
		return tcpConfiguration(tcp -> tcp.bootstrap(
				b -> HttpClientConfiguration.cookieCodec(b, encoder, decoder)));
	}
149661
protected static function defaultUpdateResponse(
        int $updated,
        string $index,
        UriInterface $requestUri,
        CrudInterface $crud,
        EncoderInterface $encoder
    ): ResponseInterface {
        $responses = static::defaultCreateResponses($requestUri, $encoder);
        if ($updated > 0 && ($model = $crud->read($index)) !== null) {
            assert(!($model instanceof PaginatedDataInterface));
            $response = $responses->getContentResponse($model);
        } else {
            $response = $responses->getCodeResponse(404);
        }

        return $response;
    }
217386
protected static function defaultGetResourceUrl(
        $model,
        UriInterface $requestUri,
        JsonSchemasInterface $jsonSchemas
    ): string {
        $schema    = $jsonSchemas->getSchema($model);
        $selfLink  = $schema->getSelfLink($model);
        $urlPrefix = (string)$requestUri->withPath('')->withQuery('')->withFragment('');
        $fullUrl   = $selfLink->getStringRepresentation($urlPrefix);

        return $fullUrl;
    }
516696
public function matches($requestUri)
    {
        $requestUri = $this->normalizeUri($requestUri);
        $regex = $this->compile();

        if (preg_match('#^'.$regex.'$#i', $requestUri, $out)) {
            $this->data = $this->getOnlyStringKeys($out);
            return true;
        }

        return false;
    }