mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-14 01:03:29 +00:00
added fts instance info as mission paramether to be passed as SQF function paramether
This commit is contained in:
@@ -38,7 +38,7 @@ func getRequest(route string) (string, error) {
|
|||||||
return string(body), nil
|
return string(body), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func postRequest(route string, body any) (string, error) {
|
func postRequest(route string, body any, token string) (string, error) {
|
||||||
jsonData, err := json.Marshal(body)
|
jsonData, err := json.Marshal(body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Error marshalling payload:", err)
|
fmt.Println("Error marshalling payload:", err)
|
||||||
@@ -55,7 +55,7 @@ func postRequest(route string, body any) (string, error) {
|
|||||||
|
|
||||||
req.Header.Set("Content-Type", "application/json")
|
req.Header.Set("Content-Type", "application/json")
|
||||||
|
|
||||||
req.Header.Set("Authorization", "Bearer token")
|
req.Header.Set("Authorization", "Bearer "+token)
|
||||||
|
|
||||||
resp, err := client.Do(req)
|
resp, err := client.Do(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -78,7 +78,7 @@ func postRequest(route string, body any) (string, error) {
|
|||||||
return string(parsedBody), nil
|
return string(parsedBody), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func putRequest(route string, body any) (string, error) {
|
func putRequest(route string, body any, token string) (string, error) {
|
||||||
jsonData, err := json.Marshal(body)
|
jsonData, err := json.Marshal(body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Error marshalling payload:", err)
|
fmt.Println("Error marshalling payload:", err)
|
||||||
@@ -95,7 +95,7 @@ func putRequest(route string, body any) (string, error) {
|
|||||||
|
|
||||||
req.Header.Set("Content-Type", "application/json")
|
req.Header.Set("Content-Type", "application/json")
|
||||||
|
|
||||||
req.Header.Set("Authorization", "Bearer token")
|
req.Header.Set("Authorization", "Bearer "+token)
|
||||||
|
|
||||||
resp, err := client.Do(req)
|
resp, err := client.Do(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user