ZimZim
ZimZim

Reputation: 3381

The combination of HTTP POST and GET requests + Javascript calling in JAVA?

Okay, this is going to be hard to explain but here goes nothing:

Lately I've been working a lot with POST and GET requests, but now I want to send a POST/GET request to this site called: http://www.mangareader.net/

The main problem I'm facing is that I want to use the search function of this site. Normally I would send a get request or something like that, but apparently this search function doesn't work that way, it works with some kind of Javascript code? I don't know exactly what it is, but try typing "Elf" in the search bar, and you'll get a drop down list of all the mangas (Japanese comics) with the word "Elf" in them. I want to know how this process is called, and how I can implement it into a Java program. For instance:

Login into a website - > Send an HTTP post request. Get HTML data back. Process the HTML data. Get the information I need from the HTML source.

Using a search function on a regular site like google.com or bing.com - > Send get request. Get HTML data back. Process the HTML data. Get the information I need from the HTML source.

Using search function on mangareader.net - > ??????????

How would I achieve this? A theoretic explanation is enough, but a practical example would be great as well.

Upvotes: 0

Views: 509

Answers (2)

Willem D'Haeseleer
Willem D'Haeseleer

Reputation: 20180

This site uses an ajax call to get a | ( pipe symbol ) seperated list from the page

/actions/search?q=term

It parses this list using string split and then makes it into combobox.

I have little experience with java, but a simple GET request to this page should work replace {term} with your search function.

http://www.mangareader.net/actions/search/?q={term}&limit=100

You can use chrome network monitor to see if for your self

Upvotes: 0

user1320635
user1320635

Reputation:

If you analyse the javascript that runs when search you get the following:

GET http://www.mangareader.net/actions/search/?q=test&limit=100 [HTTP/1.1 200 OK 113ms]

In other words, you can search on the site by a GET-request to

http://www.mangareader.net/actions/search/?q=test&limit=100

Where ?q contains your search word.

Upvotes: 1

Related Questions