package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bytez.com/models/v2/dslim/bert-base-NER"
payload := strings.NewReader("{\n \"text\": \"John Doe is a software engineer at Google\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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))
}
HttpResponse<String> response = Unirest.post("https://api.bytez.com/models/v2/dslim/bert-base-NER")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"John Doe is a software engineer at Google\"\n}")
.asString();
require 'uri'
require 'net/http'
url = URI("https://api.bytez.com/models/v2/dslim/bert-base-NER")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"John Doe is a software engineer at Google\"\n}"
response = http.request(request)
puts response.read_body
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bytez.com/models/v2/dslim/bert-base-NER"
payload := strings.NewReader("{\n \"text\": \"John Doe is a software engineer at Google\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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))
}
HttpResponse<String> response = Unirest.post("https://api.bytez.com/models/v2/dslim/bert-base-NER")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"John Doe is a software engineer at Google\"\n}")
.asString();
require 'uri'
require 'net/http'
url = URI("https://api.bytez.com/models/v2/dslim/bert-base-NER")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"John Doe is a software engineer at Google\"\n}"
response = http.request(request)
puts response.read_body