You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: http.go
    path of file: ./repos/charm/client
    
    the code of the file until where you have to start completion: package client

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
	"strconv"
	"strings"

	charm "github.com/charmbracelet/charm/proto"
)

// ErrRequestTooLarge is an error for a request that is too large.
type ErrRequestTooLarge struct {
	Size  int64
	Limit int64
}

func (err Err
    
func (cc *Client) AuthedJSONRequest(method string, path string, reqBody interface{}, respBody interface{}) error {
	buf := &bytes.Buffer{}
	err := json.NewEncoder(buf).Encode(reqBody)
	if err != nil {
		return err
	}
	headers := http.Header{
		"Content-Type": []string{"application/json"},
	}
	resp, err := cc.AuthedRequest(method, path, headers, buf)
	if err != nil {
		return err
	}
	if respBody != nil {
		defer resp.Body.Close() // nolint:errcheck
		dec := json.NewDecoder(resp.Body)
		return dec.Decode(respBody)
	}
	return nil
}