Hello All,
Ii want to know how can i check whether the response from the server is inJSON format or XML format .
Please let me know how to do this,
hisan
12
Light Poster
Recommended Answers
Jump to Postcan you be more descriptive please
Well, I mean that you could handle the server's answer like this
import json def handle_server_answer(the_answer): try: json_data = json.loads(the_answer) except ValueError: # the answer was not in json other_handler(the_answer) return # do something with the json data print("The server sent …
All 4 Replies
Gribouillis
1,391
Programming Explorer
Team Colleague
hisan
12
Light Poster
Gribouillis
1,391
Programming Explorer
Team Colleague
sneekula
969
Nearly a Posting Maven
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.