Skip to content

Latest commit

 

History

History
24 lines (20 loc) · 435 Bytes

curl.md

File metadata and controls

24 lines (20 loc) · 435 Bytes

curl

Get status code of url:

curl --head 'https://modules.vlang.io/net.http.html#get' | awk '/HTTP/ {print $2}'

Get json:

curl -s -X POST 'https://api.groq.com/openai/v1/chat/completions' \
  -H "Authorization: Bearer $KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "messages": [
      {
        "role": "user",
        "content": "'"$MSG"'"
      }
    ],
    "model": "llama3-70b-8192"
  }'