🏁API Request's

Examples of Request Forms to the Hercai API of Some Programming Languages;

πŸ–₯️ Shell

curl --request GET \
  --url 'https://hercai.onrender.com/v3/hercai?question=hi how are you?' \
  --header 'authorization: your_apikey' \
  --header 'content-type: application/json'

πŸ”΅ Go

package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {
	url := "https://hercai.onrender.com/v3/hercai?question=hi how are you?"
	req, _ := http.NewRequest("GET", url, nil)
	
	req.Header.Add("content-type", "application/json")
	req.Header.Add("authorization", "your_apikey")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))
}

🟒 NodeJS

🟑 JavaScript

β˜• Java

πŸ”΅πŸŸ‘ Python

πŸ”· PHP

Last updated

Was this helpful?