user99999
user99999

Reputation: 2024

Making a secure rest get request

Usually if I want to return some data from a server, I would make a POST request with some token inside the request body:

$token = filter_input(INPUT_POST, 'token');
$request = filter_input(INPUT_POST, 'request');

But what about securing GET rest api requests? I don't want to place tokens inside the URL. How should I send a security token inside a GET request?

Upvotes: 0

Views: 123

Answers (1)

Andrei Filimon
Andrei Filimon

Reputation: 1188

Place the token in the request header (for all request types,not just for GET).This is the recommended way.

Upvotes: 1

Related Questions