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

version» Context lines:

pike.git/lib/modules/Protocols.pmod/HTTP.pmod/module.pmod:30:   //! query variables is sent as a post request instead of a get.   //!      object get_url(string url,void|mapping query_variables, void|mapping request_headers)   {    object con=master()->resolv("Protocols")["HTTP"]["Query"]();       string prot="http",host;    int port=80;    string query; +  if(!request_headers) +  request_headers = ([]);       sscanf(url,"%[^:/]://%[^:/]:%d/%s",prot,host,port,query) == 4 ||    (port=80,sscanf(url,"%[^:/]://%[^:/]/%s",prot,host,query)) == 3 ||    (prot="http",sscanf(url,"%[^:/]:%d/%s",host,port,query)) == 3 ||    (port=80,sscanf(url,"%[^:/]/%s",host,query)) == 2 ||    (host=url,query="");       if (prot!="http")    error("Protocols.HTTP can't handle %O or any other protocol than HTTP\n",    prot);
pike.git/lib/modules/Protocols.pmod/HTTP.pmod/module.pmod:77:    return z && z->data();   }      object post_url(string url,mapping query_variables, void|mapping request_headers)   {    object con=master()->resolv("Protocols")["HTTP"]["Query"]();       string prot="http",host;    int port=80;    string query; +  if(!request_headers) +  request_headers = ([]);       sscanf(url,"%[^:/]://%[^:/]:%d/%s",prot,host,port,query) == 4 ||    (port=80,sscanf(url,"%[^:/]://%[^:/]/%s",prot,host,query)) == 3 ||    (prot="http",sscanf(url,"%[^:/]:%d/%s",host,port,query)) == 3 ||    (port=80,sscanf(url,"%[^:/]/%s",host,query)) == 2 ||    (host=url,query="");       if (prot!="http")    error("Protocols.HTTP can't handle %O or any other protocol than HTTP\n",    prot);