Execute the REST request synchronously on the calling thread, returning the result when the
operation completes.

@return The response result of the REST request.
341076
public T execute() throws ApiException, IOException {
        return client.executeRequest(this.builder, expectedCode, responseClass, needAuth);
    }
1200956
protected SofaResponse doInvokeSync(SofaRequest request, int timeout) throws InterruptedException,
        ExecutionException, TimeoutException {
        HttpResponseFuture future = new HttpResponseFuture(request, timeout);
        AbstractHttpClientHandler callback = new SyncInvokeClientHandler(transportConfig.getConsumerConfig(),
            transportConfig.getProviderInfo(), future, request, RpcInternalContext.getContext(),
            ClassLoaderUtils.getCurrentClassLoader());
        future.setSentTime();
        doSend(request, callback, timeout);
        future.setSentTime();
        return future.getSofaResponse(timeout, TimeUnit.MILLISECONDS);
    }
536909
final synchronized void invoke() {
        result = null;
        exception = null;
        try {
            result = call();
        } catch( Throwable e ) {
            exception = e;
        } finally {
        	done = true;
        }

        // let the calling thread know that we are done.
        notify();
    }
542898
public boolean waitForResponse ()
        throws TimeoutException
    {
        if (_success == 0) {
            synchronized (this) {
                try {
                    // wait for the response, timing out after a while
                    if (_timeout == NO_TIMEOUT) {
                        wait();

                    } else {
                        wait(1000L * _timeout);
                    }
                    // if we get here without some sort of response, then we've timed out
                    if (_success == 0) {
                        throw new TimeoutException();
                    }

                } catch (InterruptedException ie) {
                    throw (TimeoutException)
                        new TimeoutException().initCause(ie);
                }
            }
        }

        return (_success > 0);
    }
898921
@Override
    public Response execute(Request request) throws IOException {
        HttpURLConnection connection = openConnection(request);
        sendRequest(connection, request);
        return readResponse(connection);
    }
750659
@Override
	public HttpResponse execute() throws IOException {
		if (this.method == HttpMethod.GET) {
			String url = this.toString();
			if (url.length() > this.cutoff) {
				if (log.isLoggable(Level.FINER))
					log.finer("URL length " + url.length() + " too long, converting GET to POST: " + url);
				
				String rebase = this.baseURL + "?method=GET";
				return this.execute(HttpMethod.POST, rebase);
			}
		}

		return super.execute();
	}
573029
def execute(self):
        
        url = os.path.join(self.HTTP_ENDPOINT, self.format)
        self.response = ExportResponse.load_http_response(
            self.session.post(url, data=self.json_payload)
        )
        return self.response.result
248754
private IAsyncResultHandler<IApiConnectionResponse> createApiConnectionResponseHandler() {
        return (IAsyncResult<IApiConnectionResponse> result) -> {
            if (result.isSuccess()) {
                requestMetric.setApiEnd(new Date());
                // The result came back. NB: still need to put it through the response chain.
                apiConnectionResponse = result.getResult();
                ApiResponse apiResponse = apiConnectionResponse.getHead();
                context.setAttribute("apiman.engine.apiResponse", apiResponse); //$NON-NLS-1$

                // Execute the response chain to evaluate the response.
                responseChain = createResponseChain((ApiResponse response) -> {
                    // Send the api response to the caller.
                    final EngineResultImpl engineResult = new EngineResultImpl(response);
                    engineResult.setConnectorResponseStream(apiConnectionResponse);

                    resultHandler.handle(AsyncResultImpl.create(engineResult));

                    // We've come all the way through the response chain successfully
                    responseChain.bodyHandler(buffer -> {
                        requestMetric.setBytesDownloaded(requestMetric.getBytesDownloaded() + buffer.length());
                        engineResult.write(buffer);
                    });

                    responseChain.endHandler(isEnd -> {
                        engineResult.end();
                        finished = true;
                        metrics.record(requestMetric);
                    });

                    // Signal to the connector that it's safe to start transmitting data.
                    apiConnectionResponse.transmit();
                });

                // Write data from the back-end response into the response chain.
                apiConnectionResponse.bodyHandler(buffer -> responseChain.write(buffer));

                // Indicate back-end response is finished to the response chain.
                apiConnectionResponse.endHandler(isEnd -> responseChain.end());

                responseChain.doApply(apiResponse);
            } else {
                resultHandler.handle(AsyncResultImpl.create(result.getError()));
            }
        };
    }
698454
public CountQueryResult executeCount() {
		CountQueryResult ret = new CountQueryResult(this);
		Object so = this.queryExecutor.getMappingInfo().getInternalDomainAccess().getSyncObject();
		if (so != null) {
			synchronized (so) {
				this.queryExecutor.executeCount();
			}
		} else
			this.queryExecutor.executeCount();
		return ret;
	}
278390
@Override
    public T execute() throws Auth0Exception {
        okhttp3.Request request = createRequest();
        try (Response response = client.newCall(request).execute()) {
            return parseResponse(response);
        } catch (Auth0Exception e) {
            throw e;
        } catch (IOException e) {
            throw new Auth0Exception("Failed to execute request", e);
        }
    }
520576
protected HttpServletResponse getCurrentResponse() {
        final HttpServletResponse response = httpService.getCurrentResponse();
        if (response == null) {
            throw new IllegalStateException("No HttpServletResponse bound to current thread");
        }
        return response;
    }
1051919
@Override
	public final void run () {
		Status result = execute();
		if (result == null) throw new IllegalStateException("Invalid status 'null' returned by the execute method");
		switch (result) {
		case SUCCEEDED:
			success();
			return;
		case FAILED:
			fail();
			return;
		case RUNNING:
			running();
			return;
		default:
			throw new IllegalStateException("Invalid status '" + result.name() + "' returned by the execute method");
		}
	}
182646
def execute(self):
        
        self.response = MetricsResponse.load_http_response(
            self.session.post(self.HTTP_ENDPOINT, data=self.json_payload)
        )
        return self.response.metrics
943165
@Override
	public final T get() throws InterruptedException, ExecutionException {
		block(0);
		if (!isUnblocked()) throw new InterruptedException();
		if (hasError()) throw new ExecutionException(error);
		if (isCancelled()) throw new ExecutionException(cancel);
		return result;
	}
676196
@Override
    public MwsReader invoke() {
        HttpPost request = createRequest();
        for (int retryCount = 0;;retryCount++) {
            try {
                HttpResponse response = executeRequest(request);
                StatusLine statusLine = response.getStatusLine();
                int status = statusLine.getStatusCode();
                String message = statusLine.getReasonPhrase();
                rhmd = getResponseHeaderMetadata(response);
                String body = getResponseBody(response);
                if (status == HttpStatus.SC_OK) {
                    return new MwsXmlReader(body);
                }
                if (status == HttpStatus.SC_INTERNAL_SERVER_ERROR) {
                    if (pauseIfRetryNeeded(retryCount)) {
                        continue;
                    }
                }
                throw new MwsException(status, message, null, null, body, rhmd);
            } catch (Exception e) {
                throw MwsUtl.wrap(e);
            } finally {
                request.releaseConnection();
            }
        }
    }
315993
private CompletableFuture<ExecuteResponse> execute(ExecuteRequest request) {
    return getService(request).thenCompose(service -> service.execute(request));
  }
366843
public static <T> T executeJsonResult(HttpUriRequest request,Class<T> clazz){
		return execute(request,JsonResponseHandler.createResponseHandler(clazz));
	}