@@ -406,3 +406,35 @@ def test_direct_https_streaming(self, http_client, gunicorn_ssl_url):
406406 response = http_client .get (f"{ gunicorn_ssl_url } /stream/streaming?chunks=3" )
407407 assert response .status_code == 200
408408 assert "Chunk" in response .text
409+
410+ def test_direct_https_post_echo (self , http_client , gunicorn_ssl_url ):
411+ """Test POST echo directly to gunicorn over HTTPS."""
412+ body = b"HTTP/2 direct echo test"
413+ response = http_client .post (
414+ f"{ gunicorn_ssl_url } /http/echo" ,
415+ content = body
416+ )
417+ assert response .status_code == 200
418+ assert response .content == body
419+
420+ def test_direct_https_post_json (self , http_client , gunicorn_ssl_url ):
421+ """Test POST JSON directly to gunicorn over HTTPS."""
422+ data = {"message" : "http2 direct post" , "number" : 42 }
423+ response = http_client .post (
424+ f"{ gunicorn_ssl_url } /http/post-json" ,
425+ json = data
426+ )
427+ assert response .status_code == 200
428+ result = response .json ()
429+ assert result ["received" ]["message" ] == "http2 direct post"
430+ assert result ["received" ]["number" ] == 42
431+
432+ def test_direct_https_post_large_body (self , http_client , gunicorn_ssl_url ):
433+ """Test large POST body directly to gunicorn over HTTPS."""
434+ body = b"x" * 100000 # 100KB, spans multiple HTTP/2 DATA frames
435+ response = http_client .post (
436+ f"{ gunicorn_ssl_url } /http/echo" ,
437+ content = body
438+ )
439+ assert response .status_code == 200
440+ assert len (response .content ) == 100000
0 commit comments