You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I write a simple webhook in Django
my simple code in Django was
# this is my view.py
from django.http import HttpResponse
from django.views.decorators.http import require_POST
from django.views.decorators.csrf import csrf_exempt
@csrf_exempt
@require_POST
def test(request):
body = request.body
print(body)
return HttpResponse(status=200)
the problem is Django can not receive the body of the request
then when I press ctrl + c and stop smee then Django receive the body of the request and print it
I think my code has a problem so I send data from my local machine to the Django server
I try this and everything works fine
curl -d @test.json -H "Content-Type: application/json" -X POST http://127.0.0.1:8000/webhook/
I write a simple webhook in Django
my simple code in Django was
then in my terminal, I run
smee -u https://smee.io/YjVfdzh3EplhFGvv -t http://127.0.0.1:8000/webhook/
the problem is Django can not receive the body of the request
then when I press ctrl + c and stop smee then Django receive the body of the request and print it
I think my code has a problem so I send data from my local machine to the Django server
I try this and everything works fine
curl -d @test.json -H "Content-Type: application/json" -X POST http://127.0.0.1:8000/webhook/
then I search for another package and I find this
https://github.com/Akrog/pysmee
and it works fine and I could receive all data in my Django program from smee.io
I use:
python 3.9.1
Django 3.1.7
npm 7.5.3
smee 1.2.2
The text was updated successfully, but these errors were encountered: