How can I test the basic authentication in <http:...
# ktor
h
How can I test the basic authentication in http://ktor.io/quickstart/guides/api.html#authentication using the IDE rest client? I’ve tried
Copy code
POST <http://user:password@localhost:8080/snippets>
Content-Type: application/json
WWW-Authenticate: Basic myrealm

{
  "snippet": {
    "text": "heyho"
  }
}
which works, but I was wondering if I could also put the credentials into the request header in some way?
c
In order to send credentials for BASIC authentication, a client must send a header
Authorization: Basic $BASE64_USER_PASS
As far as I remember you can generate it by "Generate Authorization Header"
h
cool thanks!
c
Please note that there is no need for client to send
WWW-Authenticate
header: it will be ignored by a server anyway
h
Thanks for pointing out that detail.