I am trying to make a get request to stackoverflow API but I am facing a WSGI error while making the requests through POSTMAN. Here is the code snippet:
Views:
def search(requests):
query = requests.GET["query"]
response = requests.get('https://api.stackexchange.com/2.2/search/advanced?order=desc&sort=activity&q=' + query + '&site=stackoverflow')
api_Data = response.json()
return JsonResponse({"message": api_Data})
URLs:
urlpatterns = [
path('search/', views.search, name='search'),
]
I have tried I keep getting 'WSGIRequest' object has no attribute 'Get' on django but it did not work.