Search in sources :

Example 16 with Response

use of org.openclinica.ns.response.v31.Response in project sonarqube by SonarSource.

the class CeHttpServerTest method action_is_matched_on_URL_with_parameters.

@Test
public void action_is_matched_on_URL_with_parameters() throws IOException {
    Response response = call(underTest.getUrl() + "/pompom?toto=2");
    assertIsPomPomResponse(response);
}
Also used : Response(okhttp3.Response) Test(org.junit.Test)

Example 17 with Response

use of org.openclinica.ns.response.v31.Response in project sonarqube by SonarSource.

the class CeHttpServerTest method action_is_matched_on_exact_URL.

@Test
public void action_is_matched_on_exact_URL() throws IOException {
    Response response = call(underTest.getUrl() + "/pompom");
    assertIsPomPomResponse(response);
}
Also used : Response(okhttp3.Response) Test(org.junit.Test)

Example 18 with Response

use of org.openclinica.ns.response.v31.Response in project sonarqube by SonarSource.

the class CeHttpServerTest method start_starts_http_server_and_publishes_URL_in_IPC.

@Test
public void start_starts_http_server_and_publishes_URL_in_IPC() throws Exception {
    Response response = call(underTest.getUrl() + "/pompom?toto=2");
    assertIsPomPomResponse(response);
}
Also used : Response(okhttp3.Response) Test(org.junit.Test)

Example 19 with Response

use of org.openclinica.ns.response.v31.Response in project MVCHelper by LuckyJayce.

the class BooksOkHttp_SyncDataSource method loadBooks.

private List<Book> loadBooks(final int page) throws Exception {
    GetMethod method = new GetMethod("https://www.baidu.com");
    method.addHeader("a", "aaaaa");
    method.addParam("api_key", "75ee6c644cad38dc8e53d3598c8e6b6c");
    List<Book> data = method.executeSync(new ResponseParser<List<Book>>() {

        @Override
        public List<Book> parse(Response response) throws Exception {
            Thread.sleep(1000);
            List<Book> books = new ArrayList<Book>();
            for (int i = 0; i < 15; i++) {
                books.add(new Book("page" + page + "  Java编程思想 " + i, 108.00d));
            }
            mPage = page;
            return books;
        }
    });
    return data;
}
Also used : Response(okhttp3.Response) Book(com.shizhefei.test.models.enties.Book) GetMethod(com.shizhefei.mvc.http.okhttp.GetMethod) List(java.util.List) ArrayList(java.util.ArrayList)

Example 20 with Response

use of org.openclinica.ns.response.v31.Response in project feign by OpenFeign.

the class OkHttpClient method execute.

@Override
public feign.Response execute(feign.Request input, feign.Request.Options options) throws IOException {
    okhttp3.OkHttpClient requestScoped;
    if (delegate.connectTimeoutMillis() != options.connectTimeoutMillis() || delegate.readTimeoutMillis() != options.readTimeoutMillis()) {
        requestScoped = delegate.newBuilder().connectTimeout(options.connectTimeoutMillis(), TimeUnit.MILLISECONDS).readTimeout(options.readTimeoutMillis(), TimeUnit.MILLISECONDS).build();
    } else {
        requestScoped = delegate;
    }
    Request request = toOkHttpRequest(input);
    Response response = requestScoped.newCall(request).execute();
    return toFeignResponse(response).toBuilder().request(input).build();
}
Also used : Response(okhttp3.Response) Request(okhttp3.Request)

Aggregations

Response (okhttp3.Response)444 Request (okhttp3.Request)320 Test (org.junit.Test)209 IOException (java.io.IOException)158 Response (retrofit2.Response)150 ResponseBody (okhttp3.ResponseBody)128 ServiceResponse (com.microsoft.rest.ServiceResponse)114 Observable (rx.Observable)98 Call (okhttp3.Call)97 MockResponse (okhttp3.mockwebserver.MockResponse)76 RequestBody (okhttp3.RequestBody)65 OkHttpClient (okhttp3.OkHttpClient)60 Callback (okhttp3.Callback)41 List (java.util.List)39 TestClients.clientRequest (keywhiz.TestClients.clientRequest)37 RecordedRequest (okhttp3.mockwebserver.RecordedRequest)32 HttpUrl (okhttp3.HttpUrl)25 ANResponse (com.androidnetworking.common.ANResponse)23 Interceptor (okhttp3.Interceptor)23 MediaType (okhttp3.MediaType)23