+namespace mp_util = metaproxy_1::util;
+
+
+mp_util::SRU::SRU_protocol_type
+mp_util::SRU::protocol(const Z_HTTP_Request &http_req) const
+{
+ const std::string mime_urlencoded("application/x-www-form-urlencoded");
+ const std::string mime_text_xml("text/xml");
+ const std::string mime_soap_xml("application/soap+xml");
+
+ const std::string http_method(http_req.method);
+ const std::string http_type
+ = mp_util::http_header_value(http_req.headers, "Content-Type");
+
+ if (http_method == "GET")
+ return SRU_GET;
+
+ if (http_method == "POST"
+ && http_type == mime_urlencoded)
+ return SRU_POST;
+
+ if ( http_method == "POST"
+ && (http_type == mime_text_xml
+ || http_type == mime_soap_xml))
+ return SRU_SOAP;
+
+ return SRU_NONE;
+}