[Answered ]-Initiating a GET request to Django web api and send a list of ids as an array

1👍

You can parse ids list manually like this


path('details/<ids>/', views.get_details),

def parse_ids(ids: str):
    result = []
    for id in ids.split(','):
        try:
            result.append(int(id))
        except ValueError:
            pass
    return result

def get_details(request, ids):
    id_list = parse_ids(ids)
    # do stuff
    ...

Leave a comment