Here you can find the source of postDocument(String url, Collection
public static Document postDocument(String url, Collection<KeyVal> data) throws IOException
//package com.java2s; //License from project: LGPL import java.io.IOException; import java.util.Collection; import org.jsoup.Connection.KeyVal; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; public class Main { public static int TIME_OUT = 10000; public static String AUTHENTICITY_TOKEN = "e4752a824a152118492cbc21db2518a15599e3b7"; public static Document postDocument(String url, Collection<KeyVal> data) throws IOException { KeyVal kv = org.jsoup.helper.HttpConnection.KeyVal.create("authenticity_token", AUTHENTICITY_TOKEN); data.add(kv);/*from ww w . ja v a 2 s.c om*/ return Jsoup.connect(url).timeout(TIME_OUT).data(data).post(); } }