Search in sources :

Example 1 with Call

use of okhttp3.Call in project Parse-SDK-Android by ParsePlatform.

the class ParseOkHttpClient method executeInternal.

@Override
/* package */
ParseHttpResponse executeInternal(ParseHttpRequest parseRequest) throws IOException {
    Request okHttpRequest = getRequest(parseRequest);
    Call okHttpCall = okHttpClient.newCall(okHttpRequest);
    Response okHttpResponse = okHttpCall.execute();
    return getResponse(okHttpResponse);
}
Also used : Response(okhttp3.Response) ParseHttpResponse(com.parse.http.ParseHttpResponse) Call(okhttp3.Call) Request(okhttp3.Request) ParseHttpRequest(com.parse.http.ParseHttpRequest)

Example 2 with Call

use of okhttp3.Call in project sonarqube by SonarSource.

the class HttpHeadersTest method verify_headers_of_js_provided_by_plugins.

@Test
public void verify_headers_of_js_provided_by_plugins() throws Exception {
    Response response = call(orchestrator.getServer().getUrl() + "/static/uiextensionsplugin/extension.js");
    verifySecurityHeaders(response);
    verifyContentType(response, "application/javascript");
}
Also used : Response(okhttp3.Response) Test(org.junit.Test)

Example 3 with Call

use of okhttp3.Call in project sonarqube by SonarSource.

the class HttpHeadersTest method verify_headers_of_images.

@Test
public void verify_headers_of_images() throws Exception {
    Response response = call(orchestrator.getServer().getUrl() + "/images/logo.svg");
    verifySecurityHeaders(response);
    verifyContentType(response, "image/svg+xml");
    assertCacheInBrowser(response);
}
Also used : Response(okhttp3.Response) Test(org.junit.Test)

Example 4 with Call

use of okhttp3.Call in project sonarqube by SonarSource.

the class HttpHeadersTest method verify_headers_of_ws.

@Test
public void verify_headers_of_ws() throws Exception {
    Response response = call(orchestrator.getServer().getUrl() + "/api/issues/search");
    verifySecurityHeaders(response);
    verifyContentType(response, "application/json");
    assertNoCacheInBrowser(response);
}
Also used : Response(okhttp3.Response) Test(org.junit.Test)

Example 5 with Call

use of okhttp3.Call in project sonarqube by SonarSource.

the class HttpHeadersTest method verify_headers_of_css.

@Test
public void verify_headers_of_css() throws Exception {
    Response response = call(orchestrator.getServer().getUrl() + "/css/sonar." + JS_HASH + ".css");
    verifySecurityHeaders(response);
    verifyContentType(response, "text/css");
    assertCacheInBrowser(response);
}
Also used : Response(okhttp3.Response) Test(org.junit.Test)

Aggregations

ResponseBody (okhttp3.ResponseBody)532 DateTimeRfc1123 (com.microsoft.rest.DateTimeRfc1123)332 DateTime (org.joda.time.DateTime)332 Test (org.junit.Test)236 Request (okhttp3.Request)199 ServiceCall (com.microsoft.rest.ServiceCall)140 Response (okhttp3.Response)124 MockResponse (okhttp3.mockwebserver.MockResponse)119 Call (okhttp3.Call)116 Response (retrofit2.Response)104 Observable (rx.Observable)96 ServiceResponse (com.microsoft.rest.ServiceResponse)92 IOException (java.io.IOException)82 PagedList (com.microsoft.azure.PagedList)80 ServiceResponseWithHeaders (com.microsoft.rest.ServiceResponseWithHeaders)78 RecordedRequest (okhttp3.mockwebserver.RecordedRequest)72 List (java.util.List)63 RequestBody (okhttp3.RequestBody)57 Callback (okhttp3.Callback)41 OkHttpClient (okhttp3.OkHttpClient)34