Problem when doing http.post for Adonis API


#1

Hello, I’m having trouble sending an array of objects via post to the AdonisJS API from Angular 5.

In my http.post I am sending the following data:
download

My request.all () is getting the following:
Screenshot_4

I did the following to see the result:
Screenshot_5

And I got:
Screenshot_6

What I want to do is write this data (createMany) in my Mysql bank.

My problem is this [object Object], because I can not access the data and neither Adonis can save in the database.

Can anyone give me a sense of what I might be doing wrong and/or what is the possible solution to what I’m trying to do?


#2

Can you show the request headers in the network tab?


#3

Hello @virk, sorry for the delay. Just below are the headers:


#4

someone to help? Note: Even sending by Postman gives the same problem in Adonis.


#5

Have you tried posting json instead of a JS object?


#6

There are so many unknowns in your questions. I am not sure what data property is and what payload you are sending from Postman.

I send this using Insomania

With this code

And this is the output


#7

Hey, I’m sorry but I just found out the mistake is mine. The way I’m doing is correct, a middleware I use that was causing me problems. Disable and recover data normally. Thanks to everyone who was involved and sorry for the inconvenience!