Skip to content

Instantly share code, notes, and snippets.

@xeago
Created October 23, 2016 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xeago/6fcdbdea938a491c719f525cb70d43c3 to your computer and use it in GitHub Desktop.
Save xeago/6fcdbdea938a491c719f525cb70d43c3 to your computer and use it in GitHub Desktop.
> GET /api/rtm.start?token=snip HTTP/1.1
> User-Agent: curl/7.35.0
> Host: slack.com
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: application/json; charset=utf-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Access-Control-Allow-Origin: *
< Cache-Control: private, no-cache, no-store, must-revalidate
< Content-Security-Policy: referrer no-referrer;
< Date: Sun, 23 Oct 2016 20:01:12 GMT
< Expires: Mon, 26 Jul 1997 05:00:00 GMT
< Pragma: no-cache
* Server Apache is not blacklisted
< Server: Apache
< Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
< Vary: Accept-Encoding
< X-Accepted-OAuth-Scopes: rtm:stream,client
< X-Content-Type-Options: nosniff
< X-OAuth-Scopes: identify,read,post,client,apps
< X-Slack-Backend: h
< X-Slack-Req-Id: snip
< X-XSS-Protection: 0
< X-Cache: Miss from cloudfront
< Via: 1.1 c655546a4cb2031c5c0222e0ad7540da.cloudfront.net (CloudFront)
< X-Amz-Cf-Id: snip==
<
Body is long json, omitted here
Net::HTTP.get_response(URI('https://slack.com/api/rtm.start?token=snip')).each.to_a
=> [["server", "CloudFront"],
["date", "Sun, 23 Oct 2016 19:59:48 GMT"],
["content-type", "text/html"],
["content-length", "551"],
["connection", "close"],
["x-cache", "Error from cloudfront"],
["via", "1.1 8bde89521fca6545ae0cb50da67780b4.cloudfront.net (CloudFront)"],
["x-amz-cf-id", "snip"]]
=> puts Net::HTTP.get_response(URI('https://slack.com/api/rtm.start?token=snip')).body
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ERROR: The request could not be satisfied</TITLE>
</HEAD><BODY>
<H1>ERROR</H1>
<H2>The request could not be satisfied.</H2>
<HR noshade size="1px">
Bad request.
<BR clear="all">
<HR noshade size="1px">
<PRE>
Generated by cloudfront (CloudFront)
Request ID: bzR8UVqLAtRvbGQeQaeA5k825bLSynFewZjBCyU5MBq2V9C8l3pLeQ==
</PRE>
<ADDRESS>
</ADDRESS>
</BODY></HTML>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment