Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Running a curl command within py script

Thread Tools

Re: Running a curl command within py script

Gisle Vanem
Posts: n/a
"Smaran Harihar" <(E-Mail Removed)> wrote:

> i found pycurl to execute python curl command but not sure how I can
> execute the curl command using the pycurl.
> curl -u admin:geoserver -v -XPUT -H 'Content-type: text/plain' -d
> 'file:/var/www/geo/shapefile/csvQshp/Quercus_iltisii.shp'
> http://localhost:8080/geoserver/rest...i/external.shp
> ?

Off-topic, but here's an idea. Use the 'curl --libcurl foo' option to see
what setopt() calls to use in PyCurl. Like:

import sys, pycurl

c = pycurl.Curl()
c.setopt (c.URL, 'http://localhost:8080/geoserver/rest/workspaces/acme/datastores/Quercus_iltisii/external.shp')
c.setopt (c.USERPWD, 'admin:geoserver')
c.setopt (c.POSTFIELDS, 'file:/var/www/geo/shapefile/csvQshp/Quercus_iltisii.shp');



Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble running Perl script from within a Perl script Perl Misc 4 07-29-2011 01:44 PM
IRB error using curl command. Shane Nayler Ruby 0 09-17-2008 04:17 AM
Help my Linksys WRT54G router was broken into using the "curl" command Debbie Hurley Computer Security 54 07-14-2007 05:42 PM
Extract data using Curl Unix Command & Perl Script from Webpage Fiaz Idris Perl Misc 13 03-17-2005 09:19 AM
Page Curl script wanted please G Javascript 7 01-26-2004 06:17 PM