python - Translate a general urllib2.Request to curl command -



python - Translate a general urllib2.Request to curl command -

how can programmatically convert urllib2.request object equivalent curl command?

my python script constructs several urllib2.request objects, different headers , postdata. debugging purposes, i'd replay each request curl. seems tricky, must consider bash escaping , urllib2's default headers. there simple way this?

simple way run wireshark capture desired requests , replay them packet replay tool tcpreplay. if want modify parts in curl debugging wireshark show headers urllib2 setting can set them same in curl.

python curl urllib2 urllib

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -