Package com.google.api.explorer.client.base.rest

Examples of com.google.api.explorer.client.base.rest.RestApiRequest.addHeader()


    // If the user has declared a body, set it on the request.
    String body = display.getBodyText();
    if (!body.isEmpty()) {
      req.body = body;
      req.addHeader("Content-Type", "application/json");
    }

    Multimap<String, String> paramValues = display.getParameterValues();
    for (Map.Entry<String, String> entry : paramValues.entries()) {
      if (entry.getValue().isEmpty()) {
View Full Code Here


        !ExplorerConfig.PUBLIC_ONLY_APIS.contains(service.getName()));

    // Set the auth header if we have a token.
    AuthToken oauth2Token = authManager.getToken(service);
    if (oauth2Token != null) {
      req.addHeader("Authorization", "Bearer " + oauth2Token.getAuthToken());
    }

    display.setExecuting(true);

    final long start = System.currentTimeMillis();
View Full Code Here

    RestApiRequest request =
        new RestApiRequest(createDiscoveryPath(serviceName, version, callStyle));

    // If a Discovery Auth token is set, use it.
    if (Config.getDiscoveryAuthToken() != null) {
      request.addHeader("Authorization", "OAuth " + Config.getDiscoveryAuthToken());
    }

    request.send(new AsyncCallback<ApiResponse>() {
      @Override
      public void onSuccess(ApiResponse response) {
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.