addHTTPParameter
void scrapeableFile.addHTTPParameter ( HTTPParameter parameter )
Description
Dynamically add an HTTPParameter to the current scrapeable file.
Parameters
- parameter HTTPParameter object.
Return Values
Returns void.
Change Log
Version | Description |
---|---|
4.5 | Available for all editions. |
The HTTPParameter constructor is as follows: HTTPParameter( String key, String value, int sequence, String type ). Valid types for the constructor are GET, POST, and FILE. Calling this method will have no effect unless it's invoked before the file is scraped.
Examples
Add GET HTTP Parameter
// This would be in a script called "Before file is scraped"
// Create HTTP parameter "page" with a value of "3" in the first location (GET is default)
httpParameter = new com.screenscraper.common.HTTPParameter("page", "3", 1);
// Adds a new GET HTTP parameter to the current file.
scrapeableFile.addHTTPParameter( httpParameter );
// Create HTTP parameter "page" with a value of "3" in the first location (GET is default)
httpParameter = new com.screenscraper.common.HTTPParameter("page", "3", 1);
// Adds a new GET HTTP parameter to the current file.
scrapeableFile.addHTTPParameter( httpParameter );
Add POST HTTP Parameter
// This would be in a script called "Before file is scraped"
// Create HTTP parameter "page" with a value of "3" in the first location
httpParameter = new com.screenscraper.common.HTTPParameter("page", "3", 1, "POST");
// Adds a new POST HTTP parameter to the current file.
scrapeableFile.addHTTPParameter( httpParameter );
// Create HTTP parameter "page" with a value of "3" in the first location
httpParameter = new com.screenscraper.common.HTTPParameter("page", "3", 1, "POST");
// Adds a new POST HTTP parameter to the current file.
scrapeableFile.addHTTPParameter( httpParameter );
See Also
- removeHTTPParameter() [scrapeableFile] - Removes an HTTP Parameter from the request that will be made by the scrapeable file
- removeAllHTTPParameters() [scrapeableFile] - Remove all the HTTP Parameters from the request that will be made by the scrapeable file
scraper on 07/16/2010 at 4:55 pm
- Printer-friendly version
- Login or register to post comments