Monday, June 11, 2012

Sending XML Queries in python using urllib2


Query is the xml string that you want to send.  Modify the content type according to your needs.

    def send_xml_query(self, query, host, port):



        query = query.replace ('\n', '')

        headers = {"Content-type": "application/xml"}

        host = 'http://%s:%s' % (host, port)

        request = urllib2.Request(host, query, headers)

        response = urllib2.urlopen(request)

        return request, response

21 comments:

amar said...

hank you so much for putting these questions up they have been most helpful.

Unknown said...
This comment has been removed by the author.
Unknown said...

thanks you

Unknown said...

wonderful job

deepk said...

very useful and awesome collection..

sujay said...

helpful blog

Unknown said...

excellent blog python interview questions

I Digital Academy said...

Nice post.
Best SAP Training in Bangalore
Best Oracle Training in Bangalore

Unknown said...

It'S A Really Helpful Blog Thank You For Sharing.....
Advanced Digital Marketing Course in Bangalore

Unknown said...

I got nice blog
jquery interview questions
sql interview questions
sap partner companies in bangalore
sap implementation companies in bangalore
sap partners in india
aws staffing

Unknown said...

data science training in bangalore
blockchain training in bangalore
python online training

rama said...

Very nice post here and thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's.
Good discussion. Thank you.
Anexas
Six Sigma Training in Abu Dhabi
Six Sigma Training in Dammam
Six Sigma Training in Riyadh

Unknown said...

Bodhih’s Virtual Train The Trainer workshop is a Mix of self-paced, interactive, Handson experiential and Practical workshop that is applied to learn and produce better results as a trainer.

lavanya said...

Great post! I am actually getting ready to across this information, It's very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.Really very informative and creative contents. This concept is a good way to enhance the knowledge.thanks for sharing.
please keep it up.Java training in Chennai

Java Online training in Chennai

Java Course in Chennai

Best JAVA Training Institutes in Chennai

Java training in Bangalore

Java training in Hyderabad

Java Training in Coimbatore

Java Training

Java Online Training

sathya said...

Quite Interesting post!!! Thanks for posting such a useful post. I wish to read your upcoming post to enhance my skill set, keep blogging.I am reading your post from the beginning, it was so interesting to read & I feel thanks to you for posting such a good blog, keep updates regularly.
selenium training in chennai

selenium training in chennai

selenium online training in chennai

software testing training in chennai

selenium training in bangalore

selenium training in hyderabad

selenium training in coimbatore

selenium online training

selenium training

anand said...

Thanks for sharing an informative blog keep rocking bring more details.I like the helpful info you provide in your articles. I’ll bookmark your weblog and check again here regularly.

Software Testing Training in Chennai | Certification | Online
Courses



Software Testing Training in Chennai

Software Testing Online Training in Chennai

Software Testing Courses in Chennai

Software Testing Training in Bangalore

Software Testing Training in Hyderabad

Software Testing Training in Coimbatore

Software Testing Training

Software Testing Online Training

surya said...

It’s great to come across a blog every once in a while that isn’t the same out of date rehashed material. Fantastic read.


angular js training in chennai

angular training in chennai

angular js online training in chennai

angular js training in bangalore

angular js training in hyderabad

angular js training in coimbatore

angular js training

angular js online training

Ramya said...

Thank you for your informative article, I have been doing research on this subject, and for three days I keep entering sites that are supposed to have what I am searching for, only to be discouraged with the lack of what I needed. Thank you again.
DevOps Training in Chennai

DevOps Online Training in Chennai

DevOps Training in Bangalore

DevOps Training in Hyderabad

DevOps Training in Coimbatore

DevOps Training

DevOps Online Training

Revathi said...

I feel really happy to have seen your webpage.I am feeling grateful to read this.you gave a nice information for us.please updating more stuff content...thanks lot!!

Android Training in Chennai

Android Online Training in Chennai

Android Training in Bangalore

Android Training in Hyderabad

Android Training in Coimbatore

Android Training

Android Online Training

alex said...

Very nice post here and thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's.



AWS Course in Bangalore

AWS Course in Hyderabad

AWS Course in Coimbatore

AWS Course

AWS Certification Course

AWS Certification Training

AWS Online Training

AWS Training

vivekvedha said...

It'S A Really Helpful Blog Thank You For Sharing.....
acte reviews

acte velachery reviews

acte tambaram reviews

acte anna nagar reviews

acte porur reviews

acte omr reviews

acte chennai reviews

acte student reviews