Reputation: 65
Hi I am trying to capture sms parameters from a request that comes in this format
b'name=kcom-sms04&number=%2B255688121131&content=Hello'
Above appears when I print HttpRequest.body
How can I access number, content and name parameters? I use django.
Upvotes: 1
Views: 55
Reputation: 477883
Short answer: use request.POST
.
Normally these are POST parameters, you can access these with request.POST
[Django-doc], which is a QueryDict
[Django-doc]. A QueryDict
is a dictionary-like object, but where a key can map to multiple values.
For example, you can access 'kcom-sms04'
with request.POST['name']
.
Upvotes: 1