How to send a request to another server in a django view?
问题 I want to send an http request to another server in my django view like this: def django_view(request): response = send_request('http://example.com') result = do_something_with_response(response) return HttpResponse(result) How can I do that? 回答1: You can use python requests library to send the request and get the response. But you will need to format the response for your need. Here is an example of GET request: import requests def django_view(request): # get the response from the URL