Package de.taimos.httputils

Examples of de.taimos.httputils.HTTPRequest.header()


      final String body;
      final String due = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
      final String bodyString = "{\"version\":{\"name\":\"%s\",\"status\":\"closed\",\"due_date\":\"%s\"}}";
      body = String.format(bodyString, version.getName(), due);
      final HTTPRequest req = this.createRequest("/versions/" + version.getId() + ".json");
      req.header(WSConstants.HEADER_CONTENT_TYPE, Redmine.APPLICATION_JSON);
      final HttpResponse put = req.body(body).put();
      if (!WS.isStatusOK(put)) {
        this.log.error(WS.getResponseAsString(put));
        throw new RedmineException(Redmine.STATUS_CHANGE_FAILED);
      }
View Full Code Here


   */
  public void renameVersion(final Version version, final String newName) {
    try {
      final String body = String.format("{\"version\":{\"name\":\"%s\"}}", newName);
      final HTTPRequest req = this.createRequest("/versions/" + version.getId() + ".json");
      req.header(WSConstants.HEADER_CONTENT_TYPE, Redmine.APPLICATION_JSON);
      final HttpResponse put = req.body(body).put();
      if (!WS.isStatusOK(put)) {
        this.log.error(WS.getResponseAsString(put));
        throw new RedmineException(Redmine.STATUS_CHANGE_FAILED);
      }
View Full Code Here

   */
  public void createVersion(final String project, final String name) {
    try {
      final String body = String.format("{\"version\":{\"name\":\"%s\",\"status\":\"open\"}}", name);
      final HTTPRequest req = this.createRequest("/projects/" + project + "/versions.json");
      req.header(WSConstants.HEADER_CONTENT_TYPE, Redmine.APPLICATION_JSON);
      final HttpResponse put = req.body(body).post();
      if (!WS.isStatusOK(put)) {
        this.log.error(WS.getResponseAsString(put));
        throw new RedmineException(Redmine.STATUS_CHANGE_FAILED);
      }
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.