S
S
safenoob2016-06-12 15:52:07
PHP
safenoob, 2016-06-12 15:52:07

Is it possible to give the response in the header http?

I am making an API for personal use (not public). The page processes the request and returns 0 or 1. In order not to parse the entire page, you can put and get only the headers if I remember correctly ... Is it possible for the sending script to put the response in a header like: And how can this header be considered by the receiving script if curl_getinfo receives only content_type, http_code, header_size i.e. Not all. curl_setopt($main, CURLOPT_RETURNTRANSFER, 0);
header("YouRequest: 0");

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Philipp, 2016-06-12
@safenoob

Make any heading with X- prefix, for example
header('X-Your-API-Result: 1');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question