Returns the REST resource identified by {@code uri} as a JSON string.

@param link the non-templated Link of the resource
@return json
174134
private String getHalJson(final Link link) throws IOException {
        try {
            final HttpGet httpget = new HttpGet(link.getHref());
            if (link.getType().isEmpty()) {
                httpget.addHeader("Accept", "application/hal+json");
            } else {
                httpget.addHeader("Accept", link.getType());
            }

            System.out.println("|   ------------- Request --------------");
            System.out.println("|   " + httpget.getRequestLine());

            final HttpEntity entity = httpclient.execute(httpget).getEntity();
            final String json = EntityUtils.toString(entity);
            System.out.println("|   ------------- Response -------------");
            System.out.println("|   " + json);
            return json;
        } catch (final IOException e) {
            System.out.println("\nPlease start example-springboot Server before you are running the Client.\n");
            throw e;
        }
    }
822510
public JSONResource json(URI anUri, AbstractContent requestContent) throws IOException {
		return doPOSTOrPUT(anUri, requestContent, createJSONResource());
	}
1074873
@Override
    final public String getRequestURI() {
        if (null == this.myURIString) {
            this.myURIString = GenericUtils.getEnglishString(this.myURIBytes);
        }
        return this.myURIString;
    }
820804
@Override
    public URL getResource( String path )
    {
        URL url = null;
        if ( baseLoader != null )
            // classloader wants no leading slash
            url = baseLoader.getResource( path.substring(1) );
        if ( url == null )
            url = super.getResource( path );
        return url;
    }
1179940
function getJSON(url){
    url = encodeURI(url);
    var xhr = typeof XMLHttpRequest !== 'undefined' ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');

    var responseTypeAware = 'responseType' in xhr;

    xhr.open('GET', url, true);
    if (responseTypeAware) {
        xhr.responseType = 'json';
    }

    var daRequest = new Promise(function(resolve, reject){
        xhr.onreadystatechange = function(){
            var result;
            if (xhr.readyState === 4) {
                try {
                    result = responseTypeAware ? xhr.response : JSON.parse(xhr.responseText);
                    resolve(result);
                } catch (e){
                    reject(e);
                }
            }
        };
    });

    xhr.setRequestHeader('Content-type', 'application/json; charset=UTF-8');
    xhr.send();
    return daRequest;
}
530193
@GET
   @Path("/{linkFilePath}/")
   @Produces("application/octet-stream")
   public Response produceLink(@PathParam("linkFilePath") String linkFilePath, @QueryParam("path") String path,
      @Context UriInfo uriInfo)
   {

      String host = uriInfo.getRequestUri().getHost();
      String uri = uriInfo.getBaseUri().toString();

      try
      {
         LinkGenerator linkGenerator = new LinkGenerator(host, uri, path);
         byte[] content = linkGenerator.generateLinkContent();

         return Response.ok(content, MediaType.APPLICATION_OCTET_STREAM).header(HttpHeaders.CONTENT_LENGTH,
            Integer.toString(content.length)).build();

      }
      catch (IOException exc)
      {
         LOG.error(exc.getMessage(), exc);
         throw new WebApplicationException(exc);
      }

   }
270594
@Override
    public String getURI() {
        ServletRESTRequestImpl ret = castRequest();
        if (ret != null)
            return ret.getURI();
        return null;
    }
19259
public Map<String, Link> resolveLinks(String requestUrl) {
		String normalizedUrl = normalizeRequestUrl(requestUrl);
		Map<String, Link> links = new LinkedHashMap<>();
		links.put("self", new Link(normalizedUrl));
		for (ExposableEndpoint<?> endpoint : this.endpoints) {
			if (endpoint instanceof ExposableWebEndpoint) {
				collectLinks(links, (ExposableWebEndpoint) endpoint, normalizedUrl);
			}
			else if (endpoint instanceof PathMappedEndpoint) {
				String rootPath = ((PathMappedEndpoint) endpoint).getRootPath();
				Link link = createLink(normalizedUrl, rootPath);
				links.put(endpoint.getEndpointId().toLowerCaseString(), link);
			}
		}
		return links;
	}
17179
public String getString( int index ) {
      Object o = get( index );
      if( o != null ){
         return o.toString();
      }
      throw new JSONException( "JSONArray[" + index + "] not found." );
   }
647625
@Override
    public URL getResource(final String path) {
        final ResourceList resourceList = scanResult.getResourcesWithPath(path);
        if (resourceList == null || resourceList.isEmpty()) {
            return super.getResource(path);
        } else {
            return resourceList.get(0).getURL();
        }
    }
1161805
def resource_url(self):
        """"""
        self._resource_url = self._resource_url or st.get_rest_api()
        return self._resource_url
609896
public String getStringFrom(JsonValue json) {
    if (json.isString()) {
      return json.asString();
    } else {
      return json.toString();
    }
  }
962958
public RestResponse get(final String uri, final Map<String, Object> params) throws Exception {
        final String path = getPath(uri);
        final RestResponse response = request(path, HttpGet.METHOD_NAME, params);
        if (response.isError()) {
            throw new IOException(response.getResponseText());
        }
        return response;
    }
706387
private Link parseLinkHeader(final String link) throws ExternalMessageBodyException {
        final Link realLink = Link.valueOf(link);

        try {
            final String handling = realLink.getParams().get(HANDLING);
            if (handling == null || !handling.matches("(?i)" + PROXY + "|" + COPY + "|" + REDIRECT)) {
                // error
                throw new ExternalMessageBodyException(
                        "Link header formatted incorrectly: 'handling' parameter incorrect or missing");
            }
        } catch (final Exception e) {
            throw new ExternalMessageBodyException("External content link header url is malformed");
        }
        return realLink;
    }
226006
def get_resource(url):
    
    response = DAO.getURL(url, {'Accept': 'application/json',
                                'Connection': 'keep-alive'})
    if response.status != 200:
        raise DataFailureException(url, response.status, response.data)
    return json.loads(response.data)
108937
public static <T> T getRestApiResponseAsObject(String uri,
            TypeReference<T> typeReference) {
        return JMJson.withJsonResource(getResponseAsString(uri), typeReference);
    }
1009126
public JSONArray linksToJSON(Collection<Link> c) {
        JSONArray a = new JSONArray();
        for (Link l : c) {
            a.add(linkToJSON(l));
        }
        return a;
    }