Java Code Examples for org.eclipse.jetty.client.HttpRequest#getMethod()

The following examples show how to use org.eclipse.jetty.client.HttpRequest#getMethod() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SyncHttpRequestSendInterceptor.java    From skywalking with Apache License 2.0 5 votes vote down vote up
public String getHttpMethod(HttpRequest request) {
    String method = request.getMethod();

    if (method == null || method.length() == 0) {
        method = "GET";
    }

    return method;
}
 
Example 2
Source File: SyncHttpRequestSendInterceptor.java    From skywalking with Apache License 2.0 5 votes vote down vote up
public String getHttpMethod(HttpRequest request) {
    HttpMethod httpMethod = HttpMethod.GET;

    /**
     * The method is null if the client using GET method.
     *
     * @see org.eclipse.jetty.client.HttpRequest#GET(String uri)
     * @see org.eclipse.jetty.client.HttpRequest( org.eclipse.jetty.client.HttpClient client, long conversation, java.net.URI uri)
     */
    if (request.getMethod() != null) {
        httpMethod = request.getMethod();
    }

    return httpMethod.name();
}