Automation and Programmability
A REST API uses HTTP Basic authentication over unencrypted HTTP. Which change protects the credentials from being read by someone capturing network traffic?
Show the answer
Correct answerC. Use HTTPS for API requests
AWhy not this: Basic authentication already uses Base64 encoding, which can be reversed without a secret key.
BWhy not this: A JSON body remains readable in captured traffic when HTTP is unencrypted.
CWhy this is right: HTTPS encrypts the HTTP exchange with TLS, protecting credentials in transit.
DWhy not this: Changing the header does not encrypt its contents; credentials remain readable over HTTP.
HTTPS uses TLS to encrypt API traffic, protecting Basic authentication credentials in transit. Base64 encoding is reversible and provides no confidentiality.