Add X-Requested-With to server test

This commit is contained in:
Chen-I Lim 2021-02-03 10:42:06 -08:00
parent 6cc4032d18
commit 519cfacaf2

View file

@ -65,7 +65,10 @@ type Client struct {
func NewClient(url string) *Client {
url = strings.TrimRight(url, "/")
return &Client{url, url + API_URL_SUFFIX, &http.Client{}, map[string]string{}}
headers := map[string]string{
"X-Requested-With": "XMLHttpRequest",
}
return &Client{url, url + API_URL_SUFFIX, &http.Client{}, headers}
}
func (c *Client) DoApiGet(url string, etag string) (*http.Response, error) {