0

I'm a newbie building APIs with django/python

I built a dictionary object (it has lists inside other lists in it), and I want to send it to the front through one of the responses: JsonResponse, HttpResponse, etc.

What could be the way to do it?

I tried with several of them without a good response, I whether get an error, or a bad response

Thanks in advance

Rafael

Rafael
  • 2,413
  • 4
  • 32
  • 54

1 Answers1

0

I got it

Just assume that you will send an array of objects, and the front end should access the first object it finds

    myResponse = []
    myResponse.append(myObject) 
    return HttpResponse(myResponse, status=200) // status is optional
Rafael
  • 2,413
  • 4
  • 32
  • 54