Java HTML Jsoup Document postDocument(String url, Collection data)

Here you can find the source of postDocument(String url, Collection data)

Description

post Document

License

LGPL

Declaration

public static Document postDocument(String url, Collection<KeyVal> data) throws IOException 

Method Source Code

//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();
    }
}

Related

  1. getTextFromAvailableDivID(Document doc, String divID)
  2. getTitleFromDocument(Document doc)
  3. keepLineBreak(Document docRes)
  4. makeAbsolute(Document doc)
  5. normalizeWhitespaces(Document doc)
  6. removeTag(Document doc, String selector)
  7. retrieveHiddenInputs(Document doc)
  8. saveDocumentToDirectory(final org.jsoup.nodes.Document doc, final String fileName, final Path tmpDir)
  9. stripTags(Document document)