0

I wrote a PHP API where I receive data thru JSON that I write to a MYSQL DB.

I wish to send a HTTP 201 to the calling pgm before the INSERT to the db takes place. This is because sometimes I receive thousands of records and the time to process them is too long and the calling pgm times out.

I tried to place the http response instruction before the SQL INSERT code, but the HTTP response is not sent until the INSERT is completed. Any recommendation is very welcome!

0 Answers0