Closed gauntface closed 6 years ago
@gauntface If 201
s are the only acceptable status code, I am open to suggestions on changing the method signature. Maybe something like (ok bool, err error)
instead, what do other libraries do?
func SendNotification(message []byte, s *Subscription, options *Options) (ok bool, err error) { }
Ignore me. Looks like only the node version is error'ing on non-201 response (i.e. most libraries are expecting developers to check the status code.
Web push protocol dictates that a web push service must return a "201" status code to indicate a successful push.
At the moment the response is returned regardless of status code, should the library check the status code and throw if the response is invalid?