Class: Bs_HttpClient
Source Location: /core/net/http/Bs_HttpClient.class.php
Bs_Object
|
--Bs_NetApplication
|
--Bs_HttpClient
Can grab a website from the internet.
Author(s):
Version:
- 4.3.$Revision: 1.4 $ $Date: 2003/11/21 17:06:29 $
Copyright:
|
|
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
$acceptCookies = 3
[line 301]
which cookies we do accept. - = none (bool false)
- = session only
- = persistent only
- = all (session & persistent)
Tags:
$acceptType = array('*/*', 'image/gif', 'image/x-xbitmap', 'image/jpeg')
[line 226]
the accepted types. by default, the following types are accepted: '* /*', 'image/gif', 'image/x-xbitmap', 'image/jpeg' ^ this space is only here not to fuck up the doc header of the method.
Tags:
$addHeaders = NULL
[line 236]
Additional header array. note: when using POST, you do not need to set 'Content-type' and 'Content-length' yourself.
Tags:
$closeConnection = TRUE
[line 186]
by default most webservers keep the connection open when using 'HTTP/1.1'. this makes php hang until the connection times out (blocking sockets), for apache the default setting is 15 seconds afaik. thus we close the connection by default. this gets only used if the http protocol version (see var $this->sendProtocolVersion) is higher than 'HTTP/1.0'.
Tags:
$followRedirect = 5
[line 268]
should we follow an http redirect response? don't set this higher than 5, because it would mean an infinite loop. (rfc recommended) note: this is only valid for GET and HEAD requests. for POST we never do an auto-redirect, the user/coder has to do it on demand. (rfc)
Tags:
$headerParsed = NULL
[line 402]
The parsed header information.
Tags:
$headerRaw = NULL
[line 393]
The raw header information.
Tags:
$method = 'GET'
[line 204]
The request method, one of 'GET' (default), 'POST' or 'HEAD'.
Tags:
$numFollowed = 0
[line 278]
the number how many times an http redirect has been followed for the current request. read only.
Tags:
$parseHeader = FALSE
[line 384]
If header should be parsed on a call to fetchPage().
Tags:
$port = 80
[line 163]
overwrite default value
$postData = NULL
[line 247]
the vars we send to the server when using POST. a string like 'key=value&key2=value2' or an associative array like array('firstName'=>'Mike', 'lastName'=>'Smith') note: this is ignored if the method is not POST.
Tags:
$receivedCookies = NULL
[line 311]
the cookies we got from the server.
Tags:
$receivedProtocolVersion = ''
[line 196]
The http protocol version we recived from the server. it's a common behavior that you send 1.0 and receive 1.1
Tags:
$redirectHistory = NULL
[line 287]
if we had to follow redirects, this zerobased array contains the urls.
Tags:
$responseCode = NULL
[line 375]
the http response code we got from the server. read only.
Status Code Definitions
+----------------------------------------+-------------------------------------+
|HTTP/1.0 | HTTP/1.1 |
+----------------------------------------+-------------------------------------+
| Informational 1xx |
| should never be received from a | 100 Continue |
| HTTP/1.0 reply. | 101 Switching Protocols |
| Successful 2xx |
| 200 OK | 200 OK |
| 201 Created | 201 Created |
| 202 Accepted | 202 Accepted |
| | 203 Non-Authoritative Information |
| 204 No Content | 204 No Content |
| | 205 Reset Content |
| | 206 Partial Content |
| Redirection 3xx |
| 300 Multiple Choices | 300 Multiple Choices |
| 301 Moved Permanently | 301 Moved Permanently |
| 302 Moved Temporarily | 302 Found | <= !!! meaning changed !!!
| | 303 See Other |
| 304 Not Modified | 304 Not Modified |
| | 305 Use Proxy |
| | 306 |
| | 307 Temporary Redirect |
| Client Error 4xx |
| 400 Bad Request | 400 Bad Request |
| 401 Unauthorized | 401 Unauthorized |
| | 402 Payment Required |
| 403 Forbidden | 403 Forbidden |
| 404 Not Found | 404 Not Found |
| | 405 Method Not Allowed |
| | 406 Not Acceptable |
| | 407 Proxy Authentication Required |
| | 408 Request Timeout |
| | 409 Conflict |
| | 410 Gone |
| | 411 Length Required |
| | 412 Precondition Failed |
| | 413 Request Entity Too Large |
| | 414 Request-URI Too Long |
| | 415 Unsupported Media Type |
| | 416 Requested Range Not Satisfiable |
| | 417 Expectation Failed |
| Server Error 5xx |
| 500 Internal Server Error | 500 Internal Server Error |
| 501 Not Implemented | 501 Not Implemented |
| 502 Bad Gateway | 502 Bad Gateway |
| 503 Service Unavailable | 503 Service Unavailable |
| | 504 Gateway Timeout |
| | 505 HTTP Version Not Supported |
+----------------------------------------+-------------------------------------+
Tags:
$sendProtocolVersion = 'HTTP/1.0'
[line 173]
The http protocol version that gets sent to the webserver. note that when you use 'HTTP/1.1' have a look at the var $this->closeConnection.
Tags:
$stopWatch =
[line 411]
instance of Bs_StopWatch. if set then this class will take the time at some points.
Tags:
$userAgent = 'BlueShoes Walker 4.5'
[line 214]
The user agent that gets sent to the webserver. it can be important to set this correctly, because some sites (more and more) send different content to different browsers. based on the lang for example.
Tags:
Class Methods
|
|