Ejemplo n.º 1
0
CgUpnpSSDPRequest *cg_upnp_ssdprequest_new()
{
	CgUpnpSSDPRequest *ssdpReq;

	cg_log_debug_l4("Entering...\n");

	ssdpReq = cg_http_request_new();
	
	cg_http_request_seturi(ssdpReq, "*");
	cg_http_request_setversion(ssdpReq, CG_HTTP_VER11);
	cg_http_request_setcontentlength(ssdpReq, 0);

	cg_log_debug_l4("Leaving...\n");
	
	return ssdpReq;
}
Ejemplo n.º 2
0
void cg_soap_request_setcontent(CgSoapRequest *soapReq, CgXmlNode *node)
{
    CgHttpRequest *httpReq;

    cg_log_debug_l4("Entering...\n");

    httpReq = cg_soap_request_gethttprequest(soapReq);

    /**** content type ****/
    cg_http_request_setcontenttype(httpReq, CG_XML_CONTENT_TYPE);

    /**** content ****/
    cg_http_request_appendncontent(httpReq, CG_SOAP_VERSION_HEADER,
                    cg_strlen(CG_SOAP_VERSION_HEADER));
    cg_http_request_appendncontent(httpReq, CG_XML_CONTENT_LF,
                    cg_strlen(CG_XML_CONTENT_LF));
    cg_xml_node_tostring(node, TRUE, httpReq->content);

    /**** content length ****/
    cg_http_request_setcontentlength(httpReq,
                     cg_string_length(httpReq->content));

    cg_log_debug_l4("Leaving...\n");
}