package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func getAppResponseWithFile() {
// Request payload
data := map[string]string{
"prompt": "What does this image show?",
"apiKey": "your_api_key_here",
"appName": "your_app_name",
"fileUrl": "https://example.com/path/to/your/image.jpg",
}
// Convert map to JSON
jsonData, err := json.Marshal(data)
if err != nil {
fmt.Println("Error encoding JSON:", err)
return
}
// Make POST request
resp, err := http.Post("https://calstudio.com/getbackResponse",
"application/json", bytes.NewBuffer(jsonData))
if err != nil {
fmt.Println("Error making request:", err)
return
}
defer resp.Body.Close()
// Read response
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println("Error reading response:", err)
return
}
fmt.Println("Response:", string(body))
}
func main() {
getAppResponseWithFile()
}