I have a django endpoint:
def endpoint(request):
return HttpResponse("Hello!")
I call it in JS like this:
fetch(baseUrl + "endpoint", {
method: "POST",
}).then(function(data) {
// HOW DO I ACCESS THE "Hello!"?
});
How do i access the hello! in the .then part? Thanks!!