func (dc *DexClient) Ping(ctx context.Context) error {
	u, _ := url.Parse(BaseAPI)
	u.Path = PingPath
	var res string
	_, err := dc.RequestAndDecode(ctx, http.MethodGet, u.String(), nil, &res)
	switch {
	case err != nil:
		return err
	case res != "pong":
		return errors.New("unexpected response for ping")
	default:
		return nil
	}
}
Ping : Ping the API server.
package mangodex
import (
	"context"
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"log"
	"net/http"
	"net/url"
	"os"
)
const (
	BaseAPI  = "https://api.mangadex.org"
	PingPath = "ping"
)
type DexClient struct {
	client       http.Client
	header       http.Header
	logger       *log.Logger
	RefreshToken string
	isLoggedIn   bool
}
func NewDexClient() *DexClient {
	client := http.Client{}
	header := http.Header{}
	header.Add("Accept", "application/json")        
	header.Add("Content-Type", "application/json")  
	logger := log.New(os.Stderr, "mango", log.LstdFlags|log.Lshortfile)
	return &DexClient{
		client:     client,
		header:     header,
		logger:     logger,
		isLoggedIn: false,
	}
}