Created
August 26, 2017 20:24
-
-
Save salrashid123/c6aafe9f93e9f14606b232b7964537d6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ssl | |
from hyper import HTTPConnection | |
context = ssl.SSLContext(ssl.PROTOCOL_SSLv23) | |
context.load_verify_locations(cafile="CA_crt.pem") | |
context.set_alpn_protocols(['http/1.1', "spdy/1", 'spdy/2', "spdy/3"]) | |
conn = HTTPConnection('main.esodemoapp2.com', 50051, ssl_context=context, secure=True) | |
params = binascii.a2b_hex(frame) | |
headers = {"Content-type": "application/grpc", "TE": "trailers"} | |
conn.request(method="POST", url="/echo.EchoServer/SayHello", body=params, headers=headers) | |
resp = conn.get_response() | |
print response.status, response.reason | |
#print(resp.read()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment