Examples of prepareOptions()


Examples of org.asynchttpclient.AsyncHttpClient.prepareOptions()

    @Test(groups = { "default_provider", "async" })
    public void optionsTest() throws Exception {
        final AsyncHttpClient client = getAsyncHttpClient(null);
        try {
            Response response = client.prepareOptions(getTargetUrl()).execute().get();

            assertEquals(response.getStatusCode(), 200);
            assertEquals(response.getHeader("Allow"), "GET,HEAD,POST,OPTIONS,TRACE");
        } finally {
            client.close();
View Full Code Here

Examples of org.asynchttpclient.AsyncHttpClient.prepareOptions()

        AsyncHttpClient c = getAsyncHttpClient(null);
        final AtomicReference<FluentCaseInsensitiveStringsMap> responseHeaders = new AtomicReference<FluentCaseInsensitiveStringsMap>();

        try {
            final String[] expected = { "GET", "HEAD", "OPTIONS", "POST", "TRACE" };
            Future<String> f = c.prepareOptions("http://www.apache.org/").execute(new AsyncHandlerAdapter() {

                @Override
                public STATE onHeadersReceived(HttpResponseHeaders content) throws Exception {
                    responseHeaders.set(content.getHeaders());
                    return STATE.ABORT;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.