Issues HTTP GET request, converts response body to a JSON object.

@param endpoint endpoint of request url

@return response body to a JSON object

@throws IOException in case of any IO related issue
196402
public JSONObject getJsonObject(String endpoint) throws IOException {
        String res = this.get(endpoint, null, null);
        try {
            return new JSONObject(res);
        } catch (JSONException ex) {
            LOG.warn(res);
            throw ex;
        }
    }
957020
def getEndpoints(self,typeOfEndpoint=""):
		
		q = {}
		result = asyncResult()
		if typeOfEndpoint:
			q['type'] = typeOfEndpoint
			result.extra['type'] = typeOfEndpoint
		data = self._getURL("/endpoints", query = q)
		result.fill(data)
		if data.status_code == 200:
			result.error = False
		else:
			result.error = response_codes("get_endpoints",data.status_code)
		result.is_done = True
		return result
853590
function expressGetHandler(endpoint) {
  return function(req, res) {
    // We have to handle request parameters differently since they're not in the
    // request body.
    rpc.getMethod(endpoint.name)({request: req.params}, function(err, doc) {
      res.send(doc);
      res.end();
    });
  };
}
1082371
@Override
    public int getHostPort(Object endPoint)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "getHostPort", endPoint);

        int port = 0;
        if (endPoint instanceof CFEndPoint)
        {
            port = ((CFEndPoint) endPoint).getPort();
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "getHostPort", Integer.valueOf(port));
        return port;
    }
871370
public function call($endpoint, $method = 'GET', array $data = [])
    {
        if (substr($endpoint, -1) == '/') {
            $endpoint = substr($endpoint, 0, strlen($endpoint)-1);
        }
        
        self::log("Calling $method /api/$endpoint");
            
        $params = [
            'headers'=> [
                'Accept'     => sprintf('application/vnd.xac.v%d+json', self::$apiVersion),
                'AC-API-KEY' => self::$apiKey,
            ],
        ];
        
        if (count($data) > 0) {
            $params['json'] = $data;
        }
        
        try {
            $this->initTransport();
            
            $res = $this->transport->request($method, $endpoint, $params);
        } catch (ConnectException $e) {
            self::log($e->getMessage(), Logger::ERROR);
            throw new \Exception($e->getMessage());
        
        } catch (ServerException $e) {
            $response = json_decode((string) $e->getResponse()->getBody(), true);
            self::$lastResponse = $response['ACResponse'];
            self::$lastResponse['httpCode'] = $e->getResponse()->getStatusCode();
            self::log($e->getMessage(), Logger::ERROR);
            throw new \Exception(self::$lastResponse['message']);
        
        } catch (ClientException $e) {
            $response = json_decode((string) $e->getResponse()->getBody(), true);
            self::$lastResponse = $response['ACResponse'];
            self::$lastResponse['httpCode'] = $e->getResponse()->getStatusCode();
            self::log($e->getMessage(), Logger::ERROR);
            throw new \Exception(self::$lastResponse['message']);
             
        } finally {
            if (isset($res)) {
                $response = json_decode((string) $res->getBody(), !self::$returnObject);
                $response = $response['ACResponse'];
            }
        }
        
        self::$lastResponse = $response;
        
        return $response['body']['data'];
    }
490914
def get(self, endpoint):
        ''''''
        json_body = urlopen(self.url(endpoint)).read().decode('utf-8')
        return json.loads(json_body)
1364728
protected Response getResponse(Object connection, Object responseObject) throws IOException {
        Response response = new Response();
        response.setObject(responseObject);
        response.setContent(externalResponseToString(responseObject));
        return response;
    }
810938
private void validateEndpoint(String endpoint) {
        try {
            new URL(endpoint);
        } catch (MalformedURLException e) {
            throw new InvalidParameterException(Messages.i18n.format("OrganizationResourceImpl.InvalidEndpointURL")); //$NON-NLS-1$
        }
    }
1296598
def post(self, endpoint, json=None, params=None, **kwargs):
        
        json = kwargs['data'] if 'data' in kwargs else json
        return self._make_request('post', endpoint, data=json, params=params)
851217
public JsonReader endObject() throws IOException {
      if (currentValue.getKey() != END_OBJECT) {
         throw new IOException("Expecting END_OBJECT, but found " + jsonTokenToStructuredElement(null));
      }
      consume();
      return this;
   }
1330440
def endpoint(url, method="GET", expected_status=200):
    
    def dec(obj):
        obj.ENDPOINT = url
        obj.METHOD = method
        obj.EXPECTED_STATUS = expected_status
        return obj

    return dec
354644
protected void handleEndpointRequest(HttpServletRequest request, HttpServletResponse response,
			ServletContext servletContext) throws IOException {
		JwtRequest jwtRequest = getJwtRequest(request, response);
		if (jwtRequest == null) {
			// Error redirect already taken care of
			return;
		}

		String jwtConfigId = jwtRequest.getJwtConfigId();
		JwtConfig jwtConfig = getJwtConfig(response, jwtConfigId);
		if (jwtConfig == null) {
			// Error redirect already taken care of
			return;
		}

		EndpointType endpointType = jwtRequest.getType();
		handleJwtRequest(request, response, servletContext, jwtConfig, endpointType);

	}
1223328
public String putJson(String endpoint, String params, JSONObject json) throws IOException {
        return this.putJson(endpoint, params, json, "");
    }
692655
def post(self, content, endpoint=''):
        '''
        
        '''
        url = self.url(endpoint)
        post_content = json.dumps(content).encode('utf-8')
        headers = {'Content-Type': 'application/json'}
        request = Request(url, post_content, headers)

        response = urlopen(request)

        return json.loads(response.read().decode('utf-8'))
966262
public void doWithMessage(WebServiceMessage responseMessage) throws IOException, TransformerException {
        // convert and set response for later access via getResponse():
        response = endpointConfiguration.getMessageConverter().convertInbound(responseMessage, endpointConfiguration, context);
    }
1155851
private void resolveRequestEndpoint(Request<?> request, String bucketName, String key, URI endpoint) {
        ServiceEndpointBuilder builder = getBuilder(endpoint, endpoint.getScheme(), false);
        buildEndpointResolver(builder, bucketName, key).resolveRequestEndpoint(request);
    }
1021799
def get(self, endpoint, **kwargs):
        
        return self._request(requests.get, endpoint, **kwargs)