/** * Strips the API key from the request (both the http headers and the query params). */ private void stripApiKey() { request.getHeaders().remove("X-API-Key"); //$NON-NLS-1$ request.getQueryParams().remove("apikey"); //$NON-NLS-1$ }
/** * Strips the API key from the request (both the http headers and the query params). */ private void stripApiKey() { request.getHeaders().remove("X-API-Key"); //$NON-NLS-1$ request.getQueryParams().remove("apikey"); //$NON-NLS-1$ }
String endpoint = ApimanPathUtils.join(api.getEndpoint(), request.getDestination()); if (request.getQueryParams() != null && !request.getQueryParams().isEmpty()) { String delim = "?"; //$NON-NLS-1$ for (Entry<String, String> entry : request.getQueryParams()) { endpoint += delim + entry.getKey(); if (entry.getValue() != null) {
String endpoint = ApimanPathUtils.join(api.getEndpoint(), request.getDestination()); if (request.getQueryParams() != null && !request.getQueryParams().isEmpty()) { String delim = "?"; //$NON-NLS-1$ for (Entry<String, String> entry : request.getQueryParams()) { endpoint += delim + entry.getKey(); if (entry.getValue() != null) {
srequest.setType(ptRequest.method().name()); srequest.getHeaders().putAll(ptRequest.headers()); srequest.getQueryParams().putAll(ptRequest.queryParams());
srequest.setType(ptRequest.method().name()); srequest.getHeaders().putAll(ptRequest.headers()); srequest.getQueryParams().putAll(ptRequest.queryParams());
public static ApiRequest buildRequest(HttpServerRequest req, boolean isTransportSecure) { ApiRequest apimanRequest = new ApiRequest(); apimanRequest.setApiKey(parseApiKey(req)); apimanRequest.setRemoteAddr(req.remoteAddress().host()); apimanRequest.setType(req.method().toString()); apimanRequest.setTransportSecure(isTransportSecure); multimapToMap(apimanRequest.getHeaders(), req.headers(), IGNORESET); multimapToMap(apimanRequest.getQueryParams(), req.params(), Collections.<String>emptySet()); parsePath(req, apimanRequest); return apimanRequest; }
public HttpConnector connect() { String endpoint = ApimanPathUtils.join(apiPath, destination + queryParams(apiRequest.getQueryParams())); logger.debug("Connecting to {0} | ssl?: {1} port: {2} verb: {3} path: {4}", apiHost, options.isSsl(), apiPort, HttpMethod.valueOf(apiRequest.getType()), endpoint);