Keyur Padalia
Keyur Padalia

Reputation: 2097

How to send HTTP response 200 OK with body?

I have implemented a webhook receiver for a payment gateway and on receiving a successful payment event I need to reply with the status 200 ok with the body "{ success: true }".

This is what I have in my code, but how do I send the body?

header("HTTP/1.1 200 OK");

Upvotes: 0

Views: 429

Answers (1)

Paun Narcis Iulian
Paun Narcis Iulian

Reputation: 799

Just echo "{ success: true }"; 200 OK should be emitted by default, how about an unsuccessful payment? what do you need to send then.

Upvotes: 2

Related Questions