org.restlet.data.Request.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(296)

本文整理了Java中org.restlet.data.Request.<init>方法的一些代码示例,展示了Request.<init>的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.<init>方法的具体详情如下:
包路径:org.restlet.data.Request
类名称:Request
方法名:<init>

Request.<init>介绍

[英]Constructor.
[中]建造师。

代码示例

代码示例来源:origin: org.restlet/org.restlet

  1. /**
  2. * Gets the identified resource without its representation's content.
  3. *
  4. * @param resourceRef
  5. * The reference of the resource to get.
  6. * @return The response.
  7. */
  8. public final Response head(Reference resourceRef) {
  9. return handle(new Request(Method.HEAD, resourceRef));
  10. }

代码示例来源:origin: org.restlet/org.restlet

  1. /**
  2. * Puts a representation in the identified resource.
  3. *
  4. * @param resourceUri
  5. * The URI of the resource to modify.
  6. * @param entity
  7. * The entity to put.
  8. * @return The response.
  9. */
  10. public final Response put(String resourceUri, Representation entity) {
  11. return handle(new Request(Method.PUT, resourceUri, entity));
  12. }

代码示例来源:origin: org.restlet/org.restlet

  1. /**
  2. * Gets the identified resource.
  3. *
  4. * @param resourceRef
  5. * The reference of the resource to get.
  6. * @return The response.
  7. */
  8. public final Response get(Reference resourceRef) {
  9. return handle(new Request(Method.GET, resourceRef));
  10. }

代码示例来源:origin: org.restlet/org.restlet

  1. /**
  2. * Deletes the identified resource.
  3. *
  4. * @param resourceRef
  5. * The reference of the resource to delete.
  6. * @return The response.
  7. */
  8. public final Response delete(Reference resourceRef) {
  9. return handle(new Request(Method.DELETE, resourceRef));
  10. }

代码示例来源:origin: org.restlet/org.restlet

  1. /**
  2. * Deletes the identified resource.
  3. *
  4. * @param resourceUri
  5. * The URI of the resource to delete.
  6. * @return The response.
  7. */
  8. public final Response delete(String resourceUri) {
  9. return handle(new Request(Method.DELETE, resourceUri));
  10. }

代码示例来源:origin: org.restlet/org.restlet

  1. /**
  2. * Gets the identified resource.
  3. *
  4. * @param resourceUri
  5. * The URI of the resource to get.
  6. * @return The response.
  7. */
  8. public final Response get(String resourceUri) {
  9. return handle(new Request(Method.GET, resourceUri));
  10. }

代码示例来源:origin: org.restlet/org.restlet

  1. /**
  2. * Gets the options for the identified resource.
  3. *
  4. * @param resourceUri
  5. * The URI of the resource to get.
  6. * @return The response.
  7. */
  8. public final Response options(String resourceUri) {
  9. return handle(new Request(Method.OPTIONS, resourceUri));
  10. }

代码示例来源:origin: org.restlet/org.restlet

  1. /**
  2. * Gets the identified resource without its representation's content.
  3. *
  4. * @param resourceUri
  5. * The URI of the resource to get.
  6. * @return The response.
  7. */
  8. public final Response head(String resourceUri) {
  9. return handle(new Request(Method.HEAD, resourceUri));
  10. }

代码示例来源:origin: org.restlet/org.restlet

  1. /**
  2. * Gets the options for the identified resource.
  3. *
  4. * @param resourceRef
  5. * The reference of the resource to get.
  6. * @return The response.
  7. */
  8. public final Response options(Reference resourceRef) {
  9. return handle(new Request(Method.OPTIONS, resourceRef));
  10. }

代码示例来源:origin: org.restlet/org.restlet

  1. /**
  2. * Posts a representation to the identified resource.
  3. *
  4. * @param resourceRef
  5. * The reference of the resource to post to.
  6. * @param entity
  7. * The entity to post.
  8. * @return The response.
  9. */
  10. public final Response post(Reference resourceRef, Representation entity) {
  11. return handle(new Request(Method.POST, resourceRef, entity));
  12. }

代码示例来源:origin: org.restlet/org.restlet

  1. /**
  2. * Posts a representation to the identified resource.
  3. *
  4. * @param resourceUri
  5. * The URI of the resource to post to.
  6. * @param entity
  7. * The entity to post.
  8. * @return The response.
  9. */
  10. public final Response post(String resourceUri, Representation entity) {
  11. return handle(new Request(Method.POST, resourceUri, entity));
  12. }

代码示例来源:origin: org.restlet/org.restlet

  1. /**
  2. * Puts a representation in the identified resource.
  3. *
  4. * @param resourceRef
  5. * The reference of the resource to modify.
  6. * @param entity
  7. * The entity to put.
  8. * @return The response.
  9. */
  10. public final Response put(Reference resourceRef, Representation entity) {
  11. return handle(new Request(Method.PUT, resourceRef, entity));
  12. }

代码示例来源:origin: org.geoserver.extension/monitor-core

  1. @Test
  2. public void testGetByIdHTML() throws Exception {
  3. Request req = new Request();
  4. Response res = new Response(req);
  5. RequestResource.HTMLFormat format =
  6. new RequestResource.HTMLFormat(req, res, resource, monitor);
  7. ByteArrayOutputStream out = new ByteArrayOutputStream();
  8. format.toRepresentation(monitor.getDAO().getRequest(2)).write(out);
  9. assertTrue(new String(out.toByteArray()).startsWith("<html>"));
  10. }

代码示例来源:origin: org.geoserver.extension/monitor-core

  1. @Test
  2. public void testGetAll() throws Exception {
  3. Request req = new Request();
  4. Response res = new Response(req);
  5. resource.init(null, req, res);
  6. Query q = (Query) resource.handleObjectGet();
  7. assertEquals(monitor.getDAO().getRequests().size(),
  8. monitor.getDAO().getRequests(q).size());
  9. }

代码示例来源:origin: org.geoserver.extension/monitor-core

  1. @Test
  2. public void testGetById() throws Exception {
  3. Request req = new Request();
  4. req.getAttributes().put("request", 2);
  5. Response res = new Response(req);
  6. resource.init(null, req, res);
  7. RequestData data = (RequestData) resource.handleObjectGet();
  8. assertEquals("/two", data.getPath());
  9. }

代码示例来源:origin: org.geoserver.extension/monitor-core

  1. @Test
  2. public void testFilterIn() throws Exception {
  3. Request req = new Request();
  4. setKVP(req, "filter", "path:IN:/seven,/six,/five");
  5. Response res = new Response(req);
  6. resource.init(null, req, res);
  7. Query q = (Query) resource.handleObjectGet();
  8. List<RequestData> datas = (List<RequestData>) monitor.getDAO().getRequests(q);
  9. assertCovered(datas, 5, 6, 7);
  10. }

代码示例来源:origin: org.geoserver.extension/monitor-core

  1. @Test
  2. public void testGetDateRange() throws Exception {
  3. Request req = new Request();
  4. setKVP(req, "from", "2010-07-23T15:56:44", "to", "2010-07-23T16:16:44");
  5. Response res = new Response(req);
  6. resource.init(null, req, res);
  7. Query q = (Query) resource.handleObjectGet();
  8. List<RequestData> datas = (List<RequestData>) monitor.getDAO().getRequests(q);
  9. assertCoveredInOrder(datas, 6, 5, 4);
  10. }

代码示例来源:origin: org.geoserver.extension/monitor-core

  1. @Test
  2. public void testFilter() throws Exception {
  3. Request req = new Request();
  4. setKVP(req, "filter", "path:EQ:/seven");
  5. Response res = new Response(req);
  6. resource.init(null, req, res);
  7. Query q = (Query) resource.handleObjectGet();
  8. List<RequestData> datas = (List<RequestData>) monitor.getDAO().getRequests(q);
  9. assertCoveredInOrder(datas, 7);
  10. }

代码示例来源:origin: org.geoserver.extension/monitor-core

  1. @Test
  2. public void testFilterStatus() throws Exception {
  3. Request req = new Request();
  4. setKVP(req, "filter", "status:EQ:WAITING");
  5. Response res = new Response(req);
  6. resource.init(null, req, res);
  7. Query q = (Query) resource.handleObjectGet();
  8. List<RequestData> datas = (List<RequestData>) monitor.getDAO().getRequests(q);
  9. assertCovered(datas, 2,6);
  10. }

代码示例来源:origin: org.geoserver.extension/monitor-core

  1. @Test
  2. public void testLive() throws Exception {
  3. Request req = new Request();
  4. setKVP(req, "live", "yes");
  5. Response res = new Response(req);
  6. resource.init(null, req, res);
  7. Query q = (Query) resource.handleObjectGet();;
  8. List<RequestData> datas = monitor.getDAO().getRequests(q);
  9. assertCovered(datas, 1, 2, 5, 6, 9, 10);
  10. }

相关文章