Examples of Post


Examples of io.higgs.http.client.POST

        if (id == null || id.isEmpty() || connector == null) {
            throw new IllegalArgumentException("A push subscription ID and output parameters is required");
        }
        FutureData<PushSubscription> future = new FutureData<>();
        URI uri = newParams().forURL(config.newAPIEndpointURI(UPDATE));
        POST request = config.http()
                .POST(uri, new PageReader(newRequestCallback(future, new PushSubscription(), config)))
                .form("id", id);
        for (Map.Entry<String, String> e : connector.parameters().verifyAndGet().entrySet()) {
            request.form(e.getKey(), e.getValue());
        }
        if (name != null && !name.isEmpty()) {
            request.form("name", name);
        }
        applyConfig(request).execute();
        return future;
    }
View Full Code Here

Examples of javax.ws.rs.POST

    private String getHttpMethod(Method method) {
        PUT put = method.getAnnotation(PUT.class);
        if (put != null) return HttpMethod.PUT;

        POST post = method.getAnnotation(POST.class);
        if (post != null) return HttpMethod.POST;

        DELETE delete = method.getAnnotation(DELETE.class);
        if (delete != null) return HttpMethod.DELETE;
View Full Code Here

Examples of models.Post

  }
 
 
    public static void index() {
     
       Post frontPost = Post.find("order by postedAt desc").first();
         List<Post> olderPosts = Post.find(
             "order by postedAt desc"
         ).from(1).fetch(10);
         render(frontPost, olderPosts);
     
View Full Code Here

Examples of models.Post

     
    }
   
   
    public static void show(Long id) {
        Post post = Post.findById(id);
        String randomID = Codec.UUID();
        render(post, randomID);
    }
View Full Code Here

Examples of models.Post

            @Required(message="Author is required") String author,
            @Required(message="A message is required") String content,
            @Required(message="Please type the code") String code,
            String randomID)
    {
        Post post = Post.findById(postId);
        validation.equals(
            code, Cache.get(randomID)
        ).message("Invalid code. Please type it again");
        if(validation.hasErrors()) {
            render("Application/show.html", post, randomID);
        }
        post.addComment(author, content);
        flash.success("Thanks for posting %s", author);
        Cache.delete(randomID);
        show(postId);
    }
View Full Code Here

Examples of models.japidsample.Post

    Author a = new Author();
    a.name = "作者";
    a.birthDate = new Date();
    a.gender = 'm';

    final Post p = new Post();
    p.setAuthor(a);
    p.setContent("这是一个很好的内容开始和结束都很好. ");
    p.setPostedAt(new Date());
    p.setTitle("测试");

    List<Post> posts = new ArrayList<Post>();

    for (int i = 0; i < 500; i++) {
      posts.add(p);
View Full Code Here

Examples of models.japidsample.Post

    Author a = new Author();
    a.name = "作者";
    a.birthDate = new Date();
    a.gender = 'm';

    final Post p = new Post();
    p.setAuthor(a);
    p.setContent("这是一个很好的内容开始和结束都很好. ");
    p.setPostedAt(new Date());
    p.setTitle("测试");

    List<Post> posts = new ArrayList<Post>();

    for (int i = 0; i < 5; i++) {
      posts.add(p);
View Full Code Here

Examples of models.japidsample.Post

 
  /**
   * demo how to composite a page with independent segments with the #{invoke } tag
   */
  public static void composite() {
    Post post = new Post();
    post.title = "test post";
    post.postedAt = new Date();
    post.content = "this is perfect piece of content~!";
   
    Author a = new Author();
    a.name = "me";
    a.birthDate = new Date();
    a.gender = 'm';
   
    post.setAuthor(a);
   
    renderJapid(post);
  }
View Full Code Here

Examples of models.japidsample.Post

  /**
   * test the japid emailer
   */
 
  public static void email() {
    Post p = new Post();
    p.title = "我自己";
    TestEmailer.emailme(p);
    renderText("mail sent");
  }
View Full Code Here

Examples of models.japidsample.Post

    List<Post> posts = new ArrayList<Post>();
    Author a = new Author();
    a.name = "冉兵";
    a.birthDate = new Date();
    a.gender = 'M';
    Post p = new Post();
    p.author = a;
    p.content = "long time ago......";
    p.postedAt = new Date();
    p.title = "post 1";
    posts.add(p);
    p = new Post();
    p.author = a;
    p.content = "way too long time ago...";
    p.postedAt = new Date();
    p.title = "post 2";
    posts.add(p);
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.