Example usage for com.squareup.okhttp HttpUrl encodedQuery

List of usage examples for com.squareup.okhttp HttpUrl encodedQuery

Introduction

In this page you can find the example usage for com.squareup.okhttp HttpUrl encodedQuery.

Prototype

public String encodedQuery() 

Source Link

Document

Returns the query of this URL, encoded for use in HTTP resource resolution.

Usage

From source file:alberto.avengers.model.rest.utils.interceptors.HttpLoggingInterceptor.java

License:Apache License

private static String requestPath(HttpUrl url) {
    String path = url.encodedPath();
    String query = url.encodedQuery();
    return query != null ? (path + '?' + query) : path;
}

From source file:com.codenote.tikal.example.client.HttpLoggingInterceptor.java

License:Apache License

private static String requestPath(HttpUrl url) {
    String domain = url.scheme() + "://" + url.host();
    String path = url.encodedPath();
    String query = url.encodedQuery();
    return query != null ? domain.concat(path + '?' + query) : domain.concat(path);
}