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

version» Context lines:

pike.git/lib/modules/Protocols.pmod/HTTP.pmod/module.pmod:2:   //! module Protocols   //! submodule HTTP   //! method object(Protocols.HTTP.Query) get_url(string url)   //! method object(Protocols.HTTP.Query) get_url(string url,mapping query_variables)   //! Sends a HTTP GET request to the server in the URL   //! and returns the created and initialized <ref>Query</ref> object.   //! 0 is returned upon failure.   //!   //! method array(string) get_url_nice(string url)   //! method array(string) get_url_nice(string url,mapping query_variables) - //! Returns an array of ({content_type,data}) + //! method string get_url_data(string url) + //! method string get_url_data(string url,mapping query_variables) + //! Returns an array of ({content_type,data}) and just the data + //! string respective,   //! after calling the requested server for the information.   //! 0 is returned upon failure. -  + //! + //! + //! method array(string) post_url_nice(string url,mapping query_variables) + //! method string post_url_data(string url,mapping query_variables) + //! method object(Protocols.HTTP.Query) post_url(string url,mapping query_variables) + //! 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 get_url(string url,void|mapping query_variables)   {    object con=master()->resolv("Protocols")["HTTP"]["Query"]();       string prot="http",host;    int port=80;    string query;       sscanf(url,"%[^:/]://%[^:/]:%d/%s",prot,host,port,query) == 4 ||
pike.git/lib/modules/Protocols.pmod/HTTP.pmod/module.pmod:47:    if (!con->ok) return 0;    return con;   }      array(string) get_url_nice(string url,void|mapping query_variables)   {    object c=get_url(url,query_variables);    return c && ({c->headers["content-type"],c->data()});   }    - array(string) get_url_result(string url,void|mapping query_variables) + array(string) get_url_data(string url,void|mapping query_variables)   { -  return get_url(url,query_variables)[1]; +  array z=get_url(url,query_variables); +  return z && get_url(url,query_variables)[1];   }      object post_url(string url,mapping query_variables)   {    object con=master()->resolv("Protocols")["HTTP"]["Query"]();       string prot="http",host;    int port=80;    string query;   
pike.git/lib/modules/Protocols.pmod/HTTP.pmod/module.pmod:88:    if (!con->ok) return 0;    return con;   }      array(string) post_url_nice(string url,mapping query_variables)   {    object c=post_url(url,query_variables);    return c && ({c->headers["content-type"],c->data()});   }    - array(string) post_url_result(string url,mapping query_variables) + array(string) post_url_data(string url,mapping query_variables)   { -  return post_url(url,query_variables)[1]; +  array z=post_url(url,query_variables); +  return z && post_url(url,query_variables)[1];   }      //!   //! method string unentity(string s)   //! Helper function for replacing HTML entities   //! with the corresponding iso-8859-1 characters.   //! note:   //! All characters isn't replaced, only those with   //! corresponding iso-8859-1 characters.