I need to do a HTTP POST to a specific url for conducting a search (the search is only done via POST in this case) with some header fields set and some data in the body of the POST request. The server responds with a continuous stream of data (XML) until the search results end. When i print out the response for a large query i run into a "Memory Error"
I was looking at Python's Requests API. How can i stream the results of the POST response without overflowing memory?
I basically need to parse the XML and then write them to a file. How can i best achieve this?