S
S
Sezmar20212021-11-30 21:15:20
PHP
Sezmar2021, 2021-11-30 21:15:20

How to send response code to server manually?

Hey! I hope it will be clear what I wrote.

I am currently writing a chat bot in php using api https://www.jivo.ru/help/api/bot-api.html . It works like webhooks and sends data using POST JSON.

To receive requests you need a webhook on my server, to send requests you need their server. I got it all

Already learned to accept and process requests. Now I want to respond to user messages, but when I send my post request to their server, an error occurs. We with support understood why, it remains only to fix it.

What's the problem - they send me data, but I don't send them the result, whether I accepted it or not. I need to send them 200 code. But it is sent after the completion of the script, and after receiving the data, I send my data to them on the server. Therefore, my data first comes to them, and then the 200 code.

That is, now such an algorithm is "receiving data from the server -> sending my data -> sending the code", but it should be "receiving data from the server -> sending the code -> sending my data -> sending the code".

How to send it manually (I use php, curl)?

Maybe I don't understand what needs to be done. Write your guesses, I will test.

Thanks for the help!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question