Casper
Casper

Reputation: 1723

How to pass credentials to PHP api endpoint located on .htaccess protected apache web server

I currently have an apache server running and an api endpoint in PHP

https://myserver.com/api.php

The server is utilizing .htaccess authentications (auth box pops up when first open URLs).

I can make a post/get request to my endpoint successfully without any authentication, but I wonder if I enable the auth, how do I pass the credentials in a post or get request?

Upvotes: 0

Views: 1490

Answers (1)

I wrestled a bear once.
I wrestled a bear once.

Reputation: 23379

using either post or get you can send creds in the URL like so...

http://username:[email protected]/api.php

Upvotes: 1

Related Questions