In urls.py I've defined **urlpatterns**:
urlpatterns = [
path('items/<path:pk>', views.itemsPK, name='itemDetailsPK'),
...
]
and in** views.py** function:
@csrf_exempt
@api_view(['GET', 'POST', 'PUT', 'DELETE'])
@authentication_classes([BasicAuthentication, SessionAuthentication])
def itemsPK(request, pk): #(request, pk
"""
Retrieve, update or delete a code snippet.
"""
permission_classes = [permissions.IsAuthenticated]
logger = logging.getLogger('django')
logger.info( " :: foldimport:views:items :: "+ request.method+ "
request, pk="+str(pk))
...
If I send a query like ''http://127.0.0.1:8000/importvault/items/(STD-/
\000&87)'', backslash in pk will be replaced with forwardslash.
I've tried to use query parameters (pk = request.GET.get('itemNum', '')),
but it doesn't help.
Sending backslashes in the json body doesn't work as well.
How I can send parameters including backslashes? Forwardslash works
perfectly with <path:pk>.
--
Ticket URL: <https://code.djangoproject.com/ticket/34726>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => invalid
Comment:
Hello,
This ticket seems to be a support request. The best place to get answers
to your issue is using any of the user support channels from
[https://docs.djangoproject.com/en/dev/faq/help/#how-do-i-do-x-why-
doesn-t-y-work-where-can-i-go-to-get-help this link].
Since the goal of this issue tracker is to track issues about Django
itself, and not to track support requests, I'll be closing this ticket as
invalid.
--
Ticket URL: <https://code.djangoproject.com/ticket/34726#comment:1>