pike.git / lib / modules / Protocols.pmod / HTTP.pmod / module.pmod

version» Context lines:

pike.git/lib/modules/Protocols.pmod/HTTP.pmod/module.pmod:60:   //! Similar to the <ref>get_url</ref> class of functions, except that the   //! query variables is sent as a post request instead of a get.   //!      object do_method(string method,    string|Standards.URI url,    void|mapping query_variables,    void|mapping request_headers,    void|Protocols.HTTP.Query con, void|string data)   { -  if(!con) +  if(!con) {    con = Protocols.HTTP.Query(); -  +  } +  if(!request_headers) +  request_headers = ([]);    -  +     if(stringp(url))    url=Standards.URI(url);    -  if(url->scheme!="http") + #if constant(SSL.sslfile) +  if(url->scheme!="http" && url->scheme!="https") +  error("Protocols.HTTP can't handle %O or any other protocols than HTTP or HTTPS\n", +  url->scheme); +  +  con->https= (url->scheme=="https")? 1 : 0; + #else +  if(url->scheme!="http" )    error("Protocols.HTTP can't handle %O or any other protocol than HTTP\n",    url->scheme);    -  + #endif +  +     if(!request_headers)    request_headers = ([]);    mapping default_headers = ([    "user-agent" : "Mozilla/4.0 compatible (Pike HTTP client)",    "host" : url->host ]);       if(url->user || url->passwd)    default_headers->authorization = "Basic "    + MIME.encode_base64(url->user + ":" +    (url->password || ""));