We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa2e3b8 commit 4ddcfbbCopy full SHA for 4ddcfbb
src/send.jl
@@ -21,3 +21,25 @@ function sendtoslack(data::String, user_endpoint::String)
21
22
return (String(r.body))
23
end
24
+
25
+"""
26
+ sendattachmenttoslack(data::String, user_endpoint::String)
27
+Takes in a string of data and the endpoint url and returns the HTTP response.
28
+The response will be "ok" if the request is sent successfully.
29
30
+function sendattachmenttoslack(data::String, user_endpoint::String)
31
+ HTTP.setuseragent!("HTTP.jl")
32
33
34
+ params = Dict("$(data)")
35
+ base_url = "https://hooks.slack.com"
36
37
+ endpoint = user_endpoint
38
+ url = base_url * endpoint
39
40
+ r = HTTP.post(url,
41
+ ["Content-Type" => "application/json"],
42
+ JSON.json(params))
43
44
+ return (String(r.body))
45
+end
0 commit comments