1 Star 0 Fork 0

sunglowrise / stormer

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

DataClient

Introduction

this is a request tool which packaging method server

Usage

from stormer import Requester

# init Requester instance
requester = Requester(
    "https://www.baidu.com", 
    redis_url="redis://127.0.0.1:6379/0", 
    # redis_nodes="127.0.0.1:7000,127.0.0.1:7001,127.0.0.1:7002", 
    # redis_password="",
    timeout=30, # in seconds,global cache timeout
    # headers={"Content-Type": "text/html;charset=utf8"},
    encoding='utf8'
)

# open debug
requester.set_debugging()

# register request function
requester.register(
    action="get", 
    func="bd_index", 
    uri="/", 
    timeout=5  # in second, this requester cache timeout
)

# execute function
rlt = requester.bd_index()
r_byte = rlt.bytes
print(rlt.data)
print(rlt.resp)

Comments ( 0 )

Sign in for post a comment

About

No description expand collapse
Python
MIT
Cancel

Releases

No release

Contributors

All

Activities

load more
can not load any more
Python
1
https://gitee.com/sunglowrise/stormer.git
git@gitee.com:sunglowrise/stormer.git
sunglowrise
stormer
stormer
master

Search