Package org.structr.rest

Examples of org.structr.rest.RestMethodResult.addHeader()


      newNode = createNode(propertySet);

      final RestMethodResult result = new RestMethodResult(HttpServletResponse.SC_CREATED);
      if (newNode != null) {

        result.addHeader("Location", buildLocationHeader(newNode));
        result.addContent(newNode);
      }

      result.serializeAsPrimitiveArray(true);
     
View Full Code Here


              }

              // remove Location header if more than one object was
              // written because it may only contain a single URL
              result.addHeader("Location", null);
            }

            result.commitResponse(gson.get(), response);
             
          }
View Full Code Here

        newRelationship = app.create(sourceNode, targetNode, entityClass, properties);

        RestMethodResult result = new RestMethodResult(HttpServletResponse.SC_CREATED);
        if (newRelationship != null) {

          result.addHeader("Location", buildLocationHeader(newRelationship));
        }

        result.serializeAsPrimitiveArray(true);
       
        // finally: return 201 Created
View Full Code Here

      }

      if (newNode != null) {

        RestMethodResult result = new RestMethodResult(HttpServletResponse.SC_CREATED);
        result.addHeader("Location", buildLocationHeader(newNode));

        return result;
      }

    } else {
View Full Code Here

  @Override
  public RestMethodResult doOptions() throws FrameworkException {

    final RestMethodResult result = new RestMethodResult(HttpServletResponse.SC_OK);

    result.addHeader("Allow", "GET,POST,OPTIONS");

    return result;
  }

  @Override
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.