Skip to content

Instantly share code, notes, and snippets.



Created Mar 18, 2019
What would you like to do?
Doing WFS post request from python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
import requests
import argparse
def post(args):
headers = {'Content-Type': 'application/xml'}
r = = args.url, data=open(args.payload, 'rb'), headers=headers)
return r.content
if __name__ == '__main__':
parser = argparse.ArgumentParser(description = 'Does WFS POST request.')
parser.add_argument("payload", help = 'The file containing the payload for the POST request.')
parser.add_argument("url", help = 'The url to send the request to.')
args = parser.parse_args()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.