File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -4,19 +4,28 @@ import (
44 "context"
55 "fmt"
66 "log"
7+ "os"
8+
9+ "github.com/joho/godotenv"
710
811 "github.com/carlmjohnson/requests"
912 "github.com/palantir/stacktrace"
1013)
1114
1215func main () {
16+ err := godotenv .Load ("../../.env" )
17+ if err != nil {
18+ log .Fatal ("Error loading .env file" )
19+ }
20+
1321 for i := 0 ; i < 50 ; i ++ {
1422 var responsePayload string
15- err : = requests .
23+ err = requests .
1624 URL ("/v1/messages/send" ).
17- Host ("localhost:8000" ).
18- Scheme ("http" ).
19- Header ("x-api-key" , "Uv38ByGCZU8WP18PmmIdcpVmx00QA3xNe7sEB9HixkmBhVrYaB0NhtHpHgAWeTnL" ).
25+ Host ("api.httpsms.com" ).
26+ // Host("localhost:8000").
27+ // Scheme("http").
28+ Header ("x-api-key" , os .Getenv ("API_KEY" )).
2029 BodyJSON (& map [string ]string {
2130 "content" : fmt .Sprintf ("testing http api sample: [%d]" , i ),
2231 "from" : "+37259139660" ,
You can’t perform that action at this time.
0 commit comments