I was just connecting my rest API with my admin system. I recently found out that HttpService:RequestAsync() doesn’t accept encoded JSON as one of the headers. I use Postman for testing rest API requests and it allows sending a header with a JSON format. How do you fix this? My rest APIs doesn’t use the request body for retrieving data.
Http Headers:
Headers = {
["Content-Type"] = "application/json",
Authorization = "Bearer "..tostring(crossSettings.domainAuthKey),
reason = reason or "Not specified",
moderator = httpService:JSONEncode(moderator or {name = "SYSTEM", id = -1}),
}
Console error:
HTTP ERROR: Header "moderator" has unallowed character "{" in value "{"name":"Roblox trzistan#327713710","id":"327713710"}"