1- # go-http-client
1+ # httpsms-go
22
3- [ ![ Build] ( https://github.com/NdoleStudio/go-http-client /actions/workflows/main.yml/badge.svg )] ( https://github.com/NdoleStudio/go-http-client /actions/workflows/main.yml )
4- [ ![ codecov] ( https://codecov.io/gh/NdoleStudio/go-http-client /branch/main/graph/badge.svg )] ( https://codecov.io/gh/NdoleStudio/go-http-client )
5- [ ![ Scrutinizer Code Quality] ( https://scrutinizer-ci.com/g/NdoleStudio/go-http-client /badges/quality-score.png?b=main )] ( https://scrutinizer-ci.com/g/NdoleStudio/go-http-client /?branch=main )
6- [ ![ Go Report Card] ( https://goreportcard.com/badge/github.com/NdoleStudio/go-http-client )] ( https://goreportcard.com/report/github.com/NdoleStudio/go-http-client )
7- [ ![ GitHub contributors] ( https://img.shields.io/github/contributors/NdoleStudio/go-http-client )] ( https://github.com/NdoleStudio/go-http-client /graphs/contributors )
8- [ ![ GitHub license] ( https://img.shields.io/github/license/NdoleStudio/go-http-client ?color=brightgreen )] ( https://github.com/NdoleStudio/go-http-client /blob/master/LICENSE )
9- [ ![ PkgGoDev] ( https://pkg.go.dev/badge/github.com/NdoleStudio/go-http-client )] ( https://pkg.go.dev/github.com/NdoleStudio/go-http-client )
3+ [ ![ Build] ( https://github.com/NdoleStudio/httpsms-go /actions/workflows/main.yml/badge.svg )] ( https://github.com/NdoleStudio/httpsms-go /actions/workflows/main.yml )
4+ [ ![ codecov] ( https://codecov.io/gh/NdoleStudio/httpsms-go /branch/main/graph/badge.svg )] ( https://codecov.io/gh/NdoleStudio/httpsms-go )
5+ [ ![ Scrutinizer Code Quality] ( https://scrutinizer-ci.com/g/NdoleStudio/httpsms-go /badges/quality-score.png?b=main )] ( https://scrutinizer-ci.com/g/NdoleStudio/httpsms-go /?branch=main )
6+ [ ![ Go Report Card] ( https://goreportcard.com/badge/github.com/NdoleStudio/httpsms-go )] ( https://goreportcard.com/report/github.com/NdoleStudio/httpsms-go )
7+ [ ![ GitHub contributors] ( https://img.shields.io/github/contributors/NdoleStudio/httpsms-go )] ( https://github.com/NdoleStudio/httpsms-go /graphs/contributors )
8+ [ ![ GitHub license] ( https://img.shields.io/github/license/NdoleStudio/httpsms-go ?color=brightgreen )] ( https://github.com/NdoleStudio/httpsms-go /blob/master/LICENSE )
9+ [ ![ PkgGoDev] ( https://pkg.go.dev/badge/github.com/NdoleStudio/httpsms-go )] ( https://pkg.go.dev/github.com/NdoleStudio/httpsms-go )
1010
1111
12- This package provides a generic ` go ` client template for an HTTP API
12+ This package provides a generic ` go ` client template for the Http SMS Api
1313
1414## Installation
1515
16- ` go-http-client ` is compatible with modern Go releases in module mode, with Go installed:
16+ ` httpsms-go ` is compatible with modern Go releases in module mode, with Go installed:
1717
1818``` bash
19- go get github.com/NdoleStudio/go-http-client
19+ go get github.com/NdoleStudio/httpsms-go
2020```
2121
2222Alternatively the same can be achieved if you use ` import ` in a package:
2323
2424``` go
25- import " github.com/NdoleStudio/go-http-client "
25+ import " github.com/NdoleStudio/httpsms-go "
2626```
2727
2828
2929## Implemented
3030
31- - [ Status Codes ] ( #status-codes )
32- - ` GET /200 ` : OK
31+ - [ Messages ] ( #messages )
32+ - ` POST /v1/messages/send ` : Send a new SMS Message
3333
3434## Usage
3535
3636### Initializing the Client
3737
38- An instance of the client can be created using ` New() ` .
38+ An instance of the client can be created using ` httpsms. New()` .
3939
4040``` go
4141package main
4242
4343import (
44- " github.com/NdoleStudio/go-http-client "
44+ " github.com/NdoleStudio/httpsms-go "
4545)
4646
4747func main () {
48- statusClient := client .New (client .WithDelay (200 ))
48+ client := htpsms .New (htpsms .WithDelay (200 ))
4949}
5050```
5151
@@ -54,24 +54,28 @@ func main() {
5454All API calls return an ` error ` as the last return object. All successful calls will return a ` nil ` error.
5555
5656``` go
57- status , response , err := statusClient. Status . Ok (context.Background ())
57+ _ , response , err := client. Messages . Send (context.Background ())
5858if err != nil {
5959 // handle error
6060}
6161```
6262
63- ### Status Codes
63+ ### Messages
6464
65- #### ` GET /200 ` : OK
65+ #### ` POST /v1/messages/send ` : Send a new SMS Message
6666
6767``` go
68- status , response , err := statusClient.Status .Ok (context.Background ())
68+ message , response , err := client.Messages .Send (context.Background (), &MessageSendParams{
69+ Content : " This is a sample text message" ,
70+ From : " +18005550199" ,
71+ To : " +18005550100" ,
72+ })
6973
7074if err != nil {
7175 log.Fatal (err)
7276}
7377
74- log.Println (status. Description ) // OK
78+ log.Println (message. Code ) // 202
7579```
7680
7781## Testing
0 commit comments