MCPcopy
hub / github.com/linbailo/zyqinglong / do_request

Method do_request

SFSY.py:136–152  ·  view source on GitHub ↗
(self, url, data={}, req_type='post')

Source from the content-addressed store, hash-verified

134 return data
135
136 def do_request(self, url, data={}, req_type='post'):
137 self.getSign()
138 try:
139 if req_type.lower() == 'get':
140 response = self.s.get(url, headers=self.headers)
141 elif req_type.lower() == 'post':
142 response = self.s.post(url, headers=self.headers, json=data)
143 else:
144 raise ValueError('Invalid req_type: %s' % req_type)
145 res = response.json()
146 return res
147 except requests.exceptions.RequestException as e:
148 print('Request failed:', e)
149 return None
150 except json.JSONDecodeError as e:
151 print('JSON decoding failed:', e)
152 return None
153
154 def sign(self):
155 print(f'>>>>>>开始执行签到')

Callers 15

signMethod · 0.95
get_SignTaskListMethod · 0.95
doTaskMethod · 0.95
receiveTaskMethod · 0.95
do_honeyTaskMethod · 0.95
receive_honeyTaskMethod · 0.95
get_coupomMethod · 0.95
get_coupom_listMethod · 0.95
honey_damaoxianMethod · 0.95
honey_expandMethod · 0.95

Calls 3

getSignMethod · 0.95
getMethod · 0.45
postMethod · 0.45

Tested by

no test coverage detected