sql server - Python posting data to web service -
i trying write python script post data microsoft sql server database connected restful web service. however, getting error not understand , never came across before.
python code post data:
import json import requests import pprint url = 'http://192.168.1.111/api/data' data = {'id': '1', "channelid': '34','timestampid': '45'} data_json = json.dumps(data) headers = {'content-type': 'application/json'} response = requests.post(url, data=data_json, headers=headers) pprint.pprint(response.json())
i have deleted files name of json in order prevent wrong imports. above error mean? tried looking kwargs following links did not understand.
understanding kwargs in python
would appreciate assistance.
i not sure error, **args , **kwargs:
**args means can add many parameters need
**kwargs refers keywords in python, ones cannot use variable names. see:
>>> import keyword >>> print(keyword.kwlist) ['false', 'none', 'true', 'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del','elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']
Comments
Post a Comment