I’m currently attempting to integrate my game with a mongo database running on a seperate server using a custom api, however when attempting to use custom HTTP methods (for convenience sakes), I always get HttpError: Aborted. Is there a way to use non-standard HTTP methods or should I just figure use the standard ones?
This is the code I’m using (ignore the fact that I’m using roblox-ts)
public FindOne<T extends {}>(filter: T) {
return this.SendRequest(
`https://api.example.com/database/${this.DatabaseName}/${this.CollectionName}/`,
'QUERY',
'ExampleAPIKey',
{ filter }
)
}
private SendRequest<T extends {}>(url: string, Method: MethodExpanded, secretId: string, body?: T) {
let secret = undefined
if (!RunService.IsStudio()) {
secret = HttpService.GetSecret(secretId).AddPrefix('Bearer ') as unknown as string
}
return HttpService.RequestAsync({
Method: Method as Method,
Url: url,
Headers: {
Authorization: secret,
ContentType: 'application/json'
},
Body: body ? HttpService.JSONEncode(body) : undefined
})
}