func (c *Client) callString(ctx context.Context, input io.Reader, method, path string) (string, error) {
	body, err := c.call(ctx, input, method, path, nil)
	if err != nil {
		return "", err
	}
	defer body.Close()
	b := &strings.Builder{}
	if _, err := io.Copy(b, body); err != nil {
		return "", err
	}
	return b.String(), nil
}
callString makes the given request to c and returns the result as a string
and error. callString returns an error if the response code is not 200 StatusOK.
package tika
import (
	"context"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
	"reflect"
	"strings"
	"golang.org/x/net/context/ctxhttp"
)
type ClientError struct {
	StatusCode int
}
func (e ClientError) Error() string {
	return fmt.Sprintf("response code %d", e.StatusCode)
}
type Client struct {
	url string
	httpClient *http.Client
}
func NewClient(httpClient *http.Client, urlString string) *Client {
	return &Client{httpClient: httpClient, url: urlString}
}
type Parser struct {
	Name           string
	Decorated      bool
	Composite      bool
	Children       []Parser
	SupportedTypes []string
}
type MIMEType struct {
	Alias     []string
	SuperType string
}
type Detector struct {
	Name      string
	Composite bool
	Children  []Detector
}
type Translator string
const (
	Lingo24Translator   Translator = "org.apache.tika.language.translate.Lingo24Translator"
	GoogleTranslator    Translator = "org.apache.tika.language.translate.GoogleTranslator"
	MosesTranslator     Translator = "org.apache.tika.language.translate.MosesTranslator"
	JoshuaTranslator    Translator = "org.apache.tika.language.translate.JoshuaTranslator"
	MicrosoftTranslator Translator = "org.apache.tika.language.translate.MicrosoftTranslator"
	YandexTranslator    Translator = "org.apache.tika.language.translate.YandexTranslator"
)
const XTIKAContent = "X-TIKA:content"
func (c *Client) call(ctx context.Context, input io.Reader, method, path string, header http.Header) (io.ReadCloser, error) {
	if c.httpClient == nil {
		c.httpClient = http.DefaultClient
	}
	req, err := http.NewRequest(method, c.url+path, input)
	if err != nil {
		return nil, err
	}
	req.Header = header
	resp, err := ctxhttp.Do(ctx, c.httpClient, req)
	if err != nil {
		return nil, err
	}
	if resp.StatusCode != http.StatusOK {
		resp.Body.Close()
		return nil, ClientError{resp.StatusCode}
	}
	return resp.Body, nil
}