Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    The default API will not understand any custom headers sent, they will be ignored. You could add a custom endpoint to handle your request. In PHP the header values will be in the $_SERVER array. The API can respond with custom headers by using the header() function. It will only work if normal content (JSON) has not yet been sent.

    While not RESTful, requests can also be processed as AJAX through admin-ajax.php or as simple GET or POST through admin-post.php.

    Thread Starter ferjsz

    (@ferjsz)

    Thanks for the reply.

    After a month I’ve tried again without any ‘-‘ or ‘_’ character in the variable name and it works fine.

    Thanks again!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘API REST: Sending/receiving header variables’ is closed to new replies.