HTTPService "Authorization/Client Secret" header on Post request: How?

How can I add an Authorization (Client Secret) HEADER to this PostAsync?

function sendDonation(donorName, amount)
	local url = "http://localhost:3000/api/donations"
	local data = {
		donorName = donorName,
		amount = amount
	}
	local jsonData = HttpService:JSONEncode(data)

	HttpService:PostAsync(url, jsonData, Enum.HttpContentType.ApplicationJson)
end

All the posts I’ve come across are either from 2015 or are simply dealing with Retrieving data rather than posting. Is there any way to do what I want from Roblox, or do I really need to send it along with the unencrypted “data”?

You could use request Async, it allows an header parameter where you can put the application type and an authorization header that often contains API keys or a secret.

1 Like

I don’t want to request something from a server though, I just want to POST to it

Request Async is an universal method. You can choose to use either POST or GET request. Search it up in the documents