curl --request POST \
--url https://context7.com/api/v2/add/llmstxt \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"llmstxtUrl": "https://docs.example.com/llms.txt"
}'
import requests
url = "https://context7.com/api/v2/add/llmstxt"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
}
payload = {
"llmstxtUrl": "https://docs.example.com/llms.txt"
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.text)
const response = await fetch('https://context7.com/api/v2/add/llmstxt', {
method: 'POST',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"llmstxtUrl": "https://docs.example.com/llms.txt"
})
});
const data = await response.json();
console.log(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://context7.com/api/v2/add/llmstxt',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{
"llmstxtUrl": "https://docs.example.com/llms.txt"
}',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer <token>',
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
url := "https://context7.com/api/v2/add/llmstxt"
payload := strings.NewReader("{\n \"llmstxtUrl\": \"https://docs.example.com/llms.txt\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://context7.com/api/v2/add/llmstxt"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"llmstxtUrl\": \"https://docs.example.com/llms.txt\"\n}"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
require 'uri'
require 'net/http'
url = URI('https://context7.com/api/v2/add/llmstxt')
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = url.scheme == 'https'
request = Net::HTTP::Post.new(url)
request['Authorization'] = 'Bearer <token>'
request['Content-Type'] = 'application/json'
request.body = '{
"llmstxtUrl": "https://docs.example.com/llms.txt"
}'
response = http.request(request)
puts response.read_body