Skip to content

wuyunfeng/Python-FastCGI-Client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Python FastCGI Client

A Python FastCGI Client for directly access FastCGI web resource through FastCGI

How use?(You should start your FastCGI Process)

from FastCGIClient import *
client = FastCGIClient('127.0.0.1', 9000, 3000, 0)
params = dict()
documentRoot = "/Users/baidu/php_workspace"
uri = "/echo.php"
content = "name=john&address=beijing"
params = {'GATEWAY_INTERFACE': 'FastCGI/1.0',
      'REQUEST_METHOD': 'POST',
      'SCRIPT_FILENAME': documentRoot + uri,
      'SCRIPT_NAME': uri,
      'QUERY_STRING': '',
      'REQUEST_URI': uri,
      'DOCUMENT_ROOT': documentRoot,
      'SERVER_SOFTWARE': 'php/fcgiclient',
      'REMOTE_ADDR': '127.0.0.1',
      'REMOTE_PORT': '9985',
      'SERVER_ADDR': '127.0.0.1',
      'SERVER_PORT': '80',
      'SERVER_NAME': "localhost",
      'SERVER_PROTOCOL': 'HTTP/1.1',
      'CONTENT_TYPE': 'application/x-www-form-urlencoded',
      'CONTENT_LENGTH': len(content)
      }
client.request(params, content)

About

A FastCGI Client for Python (directly communicate with fastcgi-server such as PHP-FPM etc.) NOTE: Do not support python 3.x.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages