Secret
非推奨を表示
*このコンテンツは、ベータ版のAI(人工知能)を使用して翻訳されており、エラーが含まれている可能性があります。このページを英語で表示するには、 こちら をクリックしてください。
Secret データタイプは、HttpService:GetSecret() によって返された秘密コンテンツを保存します。印刷またはログにはできませんが、内蔵機能を使用して変更できます:
local HttpService = game:GetService("HttpService")local mySiteApiKey = HttpService:GetSecret("my_site")local url = "https://apis.mysite.com?apiKey="local urlWithKey = mySiteApiKey:AddPrefix(url)local params = "&request=join&user=myname"local resultingUrl = urlWithKey:AddSuffix(params)
概要
方法
AddSuffix
オリジナルの秘密と供給された文字列パラメータを結合して形成された秘密を返します。キーとクエリパラメータを含む URLを作成するときに便利。
local HttpService = game:GetService("HttpService")local googleMapsApiKey = HttpService:GetSecret("google_map")local baseUrl = "https://maps.googleapis.com/maps/api/distancematrix/json?key="local queryParams = "&destinations=" .. destination .. "&origins=" .. origin .. "&departure_time=now&units=imperial"local authedUrl = googleMapsApiKey:AddPrefix(baseUrl)local queryUrl = authedUrl:AddSuffix(queryParams)