The following python 2.7 code...
# -*- coding: utf-8 -*-
import requests
def main():
get_records = """<?xml version="1.0" encoding="UTF-8"?>
<GetRecords
xmlns="http://www.opengis.net/cat/csw/2.0.2"
xmlns:csw="http://www.opengis.net/cat/csw/2.0.2"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:ows="http://www.opengis.net/ows"
xmlns:dct="http://purl.org/dc/terms/"
xmlns:gml="http://www.opengis.net/gml"
xmlns:gmd="http://www.isotc211.org/2005/gmd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
service="CSW"
version="2.0.2"
maxRecords="{max_records}"
startPosition="1"
resultType="results"
outputFormat="application/xml"
outputSchema="http://www.isotc211.org/2005/gmd"
xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd">
<Query typeNames="gmd:MD_Metadata">
<ElementSetName typeNames="csw:IsoRecord">full</ElementSetName>
<csw:Constraint version="1.1.0">
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">
<ogc:PropertyIsLike wildCard="%" singleChar="_" escapeChar="\">
<ogc:PropertyName>apiso:Subject</ogc:PropertyName>
<ogc:Literal>%opendata%</ogc:Literal>
</ogc:PropertyIsLike>
</ogc:Filter>
</csw:Constraint>
</Query>
</GetRecords>""".format(max_records = 1) # minimal 1 !
r = requests.post('http://gdk.gdi-de.org/gdi-de/srv/eng/csw', data=get_records, headers={'content-type': 'application/xml'})
xml_string = r.content
with open('for_opendata_stackexchange_com___output.txt', 'w') as file_out:
file_out.write(xml_string)
if __name__ == '__main__':
main()
...will result in a text file starting with...
<?xml version="1.0" encoding="UTF-8"?>
<csw:GetRecordsResponse xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd">
<csw:SearchStatus timestamp="2014-02-23T21:03:24" />
<csw:SearchResults numberOfRecordsMatched="1053" numberOfRecordsReturned="1" elementSet="full" nextRecord="2">
...
So the German geo data catalogue has 1053 open data sets.