File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,16 +27,14 @@ func main() {
2727func bulkSend () {
2828 var to []string
2929 for i := 0 ; i < 100 ; i ++ {
30- to = append (to , os .Getenv ("HTTPSMS_TO " ))
30+ to = append (to , os .Getenv ("HTTPSMS_TO_BULK " ))
3131 }
3232
3333 var responsePayload string
3434 err := requests .
35- URL ("/v1/messages/send" ).
35+ URL ("/v1/messages/bulk- send" ).
3636 Host ("api.httpsms.com" ).
37- // Host("localhost:8000").
38- // Scheme("http").
39- Header ("x-api-key" , os .Getenv ("HTTPSMS_KEY" )).
37+ Header ("x-api-key" , os .Getenv ("HTTPSMS_KEY_BULK" )).
4038 BodyJSON (& map [string ]any {
4139 "content" : fmt .Sprintf ("Bulk Load Test [%s]" , time .Now ().Format (time .RFC850 )),
4240 "from" : os .Getenv ("HTTPSMS_FROM_BULK" ),
@@ -46,7 +44,8 @@ func bulkSend() {
4644 ToString (& responsePayload ).
4745 Fetch (context .Background ())
4846 if err != nil {
49- log .Fatal (stacktrace .Propagate (err , "cannot create json payload" ))
47+ log .Println (responsePayload )
48+ log .Fatal (stacktrace .Propagate (err , "cannot create request" ))
5049 }
5150 log .Println (responsePayload )
5251}
You can’t perform that action at this time.
0 commit comments