Opened 16 years ago
Last modified 14 years ago
#2794 new enhancement
add POST tests to msautotest/wxs where applicable
Reported by: | tomkralidis | Owned by: | nsavard |
---|---|---|---|
Priority: | normal | Milestone: | 6.0 release |
Component: | msautotest | Version: | svn-trunk (development) |
Severity: | normal | Keywords: | |
Cc: | bartvde@…, assefa, warmerdam, dmorissette |
Description
Norm: Bart's testcase in #1287 shows a good example of doing HTTP POST requests from python.
We should investigate the feasibility of if/how to add something like this to msautotest to be able to test OWS HTTP POST functionality.
Here's an example:
#!/usr/bin/python import httplib, urllib, string, base64, time # 1) set variable for request to be posted request=""" <GetFeature service="WFS" version="1.0.0" xmlns="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0 WFS-basic.xsd"> <Query typeName="service_resources"> <ogc:Filter> <ogc:PropertyIsLike wildCard="*" singleChar="." escape="!"> <ogc:PropertyName>keywords</ogc:PropertyName> <ogc:Literal>*birds*</ogc:Literal> </ogc:PropertyIsLike> </ogc:Filter> </Query> </GetFeature> """ # set WFS servername and hostname hostname="devgeo.cciw.ca" server="/cgi-bin/mapserv/owscat" # execute the request h = httplib.HTTP(hostname) h.putrequest("POST", server) h.putheader("Content-type", "text/xml") h.putheader("Content-length", "%d" % len(request)) h.putheader("Accept", "text/xml") h.putheader('Host', hostname) h.endheaders() h.send(request) reply, msg, hdrs = h.getreply() # print the response print h.getfile().read()
Change History (3)
comment:1 by , 16 years ago
Cc: | added |
---|---|
Owner: | changed from | to
comment:2 by , 16 years ago
comment:3 by , 14 years ago
Milestone: | 5.6 release → 6.0 release |
---|
Note:
See TracTickets
for help on using tickets.
Tom: I'll check that and let you know.