Changed POST API content-type to application/json

Fixed AddMember response parsing
added bot post message example
This commit is contained in:
densestvoid
2020-08-24 22:44:28 -04:00
parent d8cdcf4ef2
commit f900b99dac
4 changed files with 33 additions and 1 deletions

View File

@ -30,6 +30,14 @@ func (s *ClientSuite) TestClient_Close() {
s.Assert().NoError(s.client.Close())
}
func (s *ClientSuite) TestClient_do_PostContentType() {
req, err := http.NewRequest("POST", "", nil)
s.Require().NoError(err)
s.Assert().Error(s.client.do(req, struct{}{}))
s.Assert().EqualValues(req.Header.Get("Content-Type"), "application/json")
}
func (s *ClientSuite) TestClient_do_DoError() {
req, err := http.NewRequest("", "", nil)
s.Require().NoError(err)