A
A
Antonzm2016-04-21 15:18:27
Java
Antonzm, 2016-04-21 15:18:27

Can't send a POST request correctly?

Using this code, I'm trying to send a post request, which theoretically should return xml or json, but as a result it returns stupidly the page to which I connected

Connection.Response connection =  Jsoup.connect("http://readmanga.me")
                        .userAgent(UserAgent)
                        .ignoreContentType(true)
                        .header("Content-Encoding", "gzip")
                        .header("Content-Language", "ru")
                        .header("Content-Type","text/html;charset=UTF-8")
                        .cookie("_ga", "GA1.2.2085812534.1461172815")
                        .cookie("_gat","1")
                        .cookie("_ym_isad","1")
                        .cookie("ym_uid","1460995028545940403")
                        .cookie("JSESSIONID","B73F1587B25CB4271E54792BE3347FBB")
                        .cookie("skin","sk6")
                        .cookie("sso_timeout","1")
                        .data("q", "online")
                        .referrer("http://readmanga.me/search")
                        .method(Connection.Method.POST)
                        .execute();
                doc = connection.parse();

I already tried to add and change everything, but I don’t want to and that’s it, where is the error? post request was tracked using a feeder.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2016-04-21
@Antonzm

And who told you that a request to readmanga.me should return json?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question