1

I just want to send a post request to submit a form to a website who only use h2 protocol.

import requests
from hyper.contrib import HTTP20Adapter
import hyper

session = requests.session()

session.mount(url, HTTP20Adapter())

r = session.post(url, data=payload, headers=header)


print(r.text)

This doesn't seem to work. And since Hyper documentation is pretty empty. I needed some external help.

Thank you in advance

  • 2
    You have neither supplied enough code that allows to reproduce the problem nor given a proper error description. – Klaus D. Mar 25 '18 at 20:25

1 Answers1

1

I think it is a bug in hyper library (tested with Release v0.7.0.). I have the same problem with raw hyper library and I had to set Content-Length query header. Without this header hyper HTTP/2 do not send query body. With HTTP/1.1 it works as expected without setting Content-Length header.

It was reported as bug: https://github.com/Lukasa/hyper/issues/320

Michał Niklas
  • 53,067
  • 18
  • 70
  • 114