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,
Jump to Post
can 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
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.