Category:HTTP: Difference between revisions
Gordon.dye (talk | contribs) |
|||
(8 intermediate revisions by 3 users not shown) | |||
Line 7: | Line 7: | ||
*[[cURL]] | *[[cURL]] | ||
*[http://brforum.BRulesCorp.com/viewtopic.php?t=142 BR Forum > Advanced Concepts > BR 4.2 HTTP - CLIENT] | *[http://brforum.BRulesCorp.com/viewtopic.php?t=142 BR Forum > Advanced Concepts > BR 4.2 HTTP - CLIENT] | ||
*[[http.zip]] | *[[http.zip]] from [[ftp://ftp.brulescorp.com/Dll_Distr/examples/]] contains a required [[ca-bundle.crt]] for HTTPS connections along with samples. | ||
*[[Connecting to browsers online Tutorial]] | |||
The [[OPEN]] string for [[ | The [[Open Display|OPEN]] string for [[Display Files|DISPLAY]] files will support a new parameter called HTTP=CLIENT. | ||
===HTTP = CLIENT=== | |||
===HTTP | |||
OPEN | OPEN | ||
HTTP=CLIENT | |||
NAME=Full URL (web page reference) | NAME=Full URL (web page reference) | ||
CONTROL=display-filename | [CONTROL=display-filename] | ||
PRINT (accumulate post data) | |||
Optional PRINT (accumulate post data) [ ... ] | |||
* when the first LINPUT is issued POSTing of all print lines occurs; and | * when the first LINPUT is issued POSTing of all print lines occurs; and | ||
* all responses are buffered before the LINPUT returns data. | * all responses are buffered before the LINPUT returns data. | ||
* If no PRINT statements are issued, the Linput performs a GET rather than a POST. | |||
* Releases prior to 4.31ga required a PRINT before the first LINPUT. | |||
LINPUT | LINPUT | ||
* until EOF is reached or until another PRINT is issued | * until EOF is reached or until another PRINT is issued | ||
* a PRINT clears the LINPUT buffer | * a PRINT clears the LINPUT buffer | ||
Processing must be performed in the above sequence or an error is generated. | Processing must be performed in the above sequence or an error is generated. | ||
Line 58: | Line 35: | ||
[[4340]] An HTTP error has occurred. See [[SYSERR]] and [[SYSERR$]]. | [[4340]] An HTTP error has occurred. See [[SYSERR]] and [[SYSERR$]]. | ||
===CONTROL Statements=== | ===Optional CONTROL Statements=== | ||
These are case insensitive. | These are case insensitive. | ||
'''LOG filename''' | |||
Write all HTTPINFO messages and RESULT strings into filename. | |||
'''USER-AGENT''' string | '''USER-AGENT''' string | ||
Specify the User-Agent string to send to the HTTP server. Some badly done CGIs fail if its not set to "Mozilla/4.0". To encode blanks in the string, surround the string with single quote marks. | Specify the User-Agent string to send to the HTTP server. Some badly done CGIs fail if its not set to "Mozilla/4.0". To encode blanks in the string, surround the string with single quote marks. | ||
Line 67: | Line 49: | ||
'''COOKIE''' “NAME=data” | '''COOKIE''' “NAME=data” | ||
e. g. “NAME1=value1; NAME2=value2" | e. g. “NAME1=value1; NAME2=value2" | ||
Line 94: | Line 77: | ||
'''SSLV2''' - force SSL version 2 | '''SSLV2''' - force SSL version 2 | ||
'''SSLV3''' - force SSL version 3 | '''SSLV3''' - force SSL version 3 | ||
'''WRITE-OUT''' string | '''WRITE-OUT''' string | ||
Used with the following optional substitution values: | Used with the following optional substitution values: | ||
Latest revision as of 16:21, 17 March 2015
More information about HTTP or Hypertext Transfer Protocol can be found at Wikipedia:Hypertext Transfer Protocol.
Business Rules! 4.20 introduces HTTP support.
See also:
- BR Web Scripting Bridge
- cURL
- BR Forum > Advanced Concepts > BR 4.2 HTTP - CLIENT
- http.zip from [[1]] contains a required ca-bundle.crt for HTTPS connections along with samples.
- Connecting to browsers online Tutorial
The OPEN string for DISPLAY files will support a new parameter called HTTP=CLIENT.
HTTP = CLIENT
OPEN
HTTP=CLIENT NAME=Full URL (web page reference) [CONTROL=display-filename]
Optional PRINT (accumulate post data) [ ... ]
- when the first LINPUT is issued POSTing of all print lines occurs; and
- all responses are buffered before the LINPUT returns data.
- If no PRINT statements are issued, the Linput performs a GET rather than a POST.
- Releases prior to 4.31ga required a PRINT before the first LINPUT.
LINPUT
- until EOF is reached or until another PRINT is issued
- a PRINT clears the LINPUT buffer
Processing must be performed in the above sequence or an error is generated.
FILE$(fileno,”HTTPINFO”) returns LOG info for the latest action.
New Error Code- 4340 An HTTP error has occurred. See SYSERR and SYSERR$.
Optional CONTROL Statements
These are case insensitive.
LOG filename
Write all HTTPINFO messages and RESULT strings into filename.
USER-AGENT string
Specify the User-Agent string to send to the HTTP server. Some badly done CGIs fail if its not set to "Mozilla/4.0". To encode blanks in the string, surround the string with single quote marks.
REFERER the linked-from URL
COOKIE “NAME=data”
e. g. “NAME1=value1; NAME2=value2"
If no '=' letter is used in the line, it is treated as a filename used to read previously stored cookie lines from, which should be used in this session if they match. Using this method also activates the "cookie parser" which will record incoming cookies too, which may be handy if you're using this in combination with the -L/--location option. The file format of the file to read cookies from should be plain HTTP headers or the Netscape/Mozilla cookie file format.
NOTE that the file specified with COOKIE is only used as input. No cookies will be stored in the file. To store cookies, save the HTTP headers to a file using DUMP-HEADER.
COOKIE-JAR filename
The name of a file that is to contain a copy of all cookies encountered either inbound or outbound.
DATA filename
Sends the specified data in a POST request to the HTTP server, in a way that can emulate as if a user has filled in a HTML form and pressed the submit button. The data is sent exactly as specified with all newlines cut off. It is expected to be "url-encoded". This will cause curl to pass the data to the server using the content-type application/x-www-form-urlencoded. If more than one DATA option is used on the same command line, the data pieces specified will be merged together with a separating semicolon. Thus, using 'DATA name=daniel skill=great' would generate a post chunk that looks like 'name=daniel&skill=great'.
If you start the data with the letter @, the rest should be a file name to read the data from. The contents of the file must already be url-encoded. Multiple files can also be specified. Posting data from a file named 'footbar' would thus be done with "DATA @footbar".
HEADER additional header parameters
Extra header to use when getting a web page. You may specify any number of extra headers.
DUMP-HEADERS filename
Write the HTTP headers to this file.
HEAD – retrieve headers only
SSLV2 - force SSL version 2
SSLV3 - force SSL version 3
WRITE-OUT string
Used with the following optional substitution values:
url_effective The URL that was fetched last.
http_code The numerical code that was found in the last retrieved HTTP(S) page.
time_total The total time, in seconds, that the full operation lasted. The time will be displayed with millisecond resolution.
time_namelookup The time, in seconds, it took from the start until the name resolving was completed.
time_connect The time, in seconds, it took from the start until the connect to the remote host (or proxy) was completed.
time_pretransfer The time, in seconds, it took from the start until the file transfer is just about to begin. This includes all pre-transfer commands and negotiations that are specific to the particular protocol(s) involved.
time_starttransfer The time, in seconds, it took from the start until the first byte is just about to be transferred. This includes time_pretransfer and also the time the server needs to calculate the result.
size_download The total amount of bytes that were downloaded.
size_upload The total amount of bytes that were uploaded.
size_header The total amount of bytes of the downloaded headers.
size_request The total amount of bytes that were sent in the HTTP request.
speed_download The average download speed that BR measured for the complete download.
speed_upload The average upload speed that BR measured for the complete upload.
content_type The Content-Type of the requested document, if there was any.