## README
### Installation
+ install with `pip` tool.
```bash
# install alibabacloud_fc_open20210406
pip install -U alibabacloud_fc_open20210406
```
### Usage
+ Invoke HTTP Trigger
```python
# -*- coding: utf-8 -*-
import os
from alibabacloud_fc_open20210406.client import Client
from alibabacloud_tea_openapi import models as open_api_models
ak = os.getenv('ak')
sk = os.getenv('sk')
url = os.getenv('url')
client = Client(config=open_api_models.Config(access_key_id=ak,
access_key_secret=sk,
region_id='cn-hangzhou'))
resp = client.invoke_httptrigger(url=url,
method="GET",
body="anything".encode(encoding='utf-8'),
headers={"k1": "v1", "k2": "v2"})
```
+ Invoke Anonymous HTTP Trigger
```python
import os
from alibabacloud_fc_open20210406.client import Client
from alibabacloud_tea_openapi import models as open_api_models
ak = os.getenv('ak')
sk = os.getenv('sk')
url = os.getenv('url')
client = Client(config=open_api_models.Config(access_key_id=ak,
access_key_secret=sk,
region_id='cn-hangzhou'))
resp = client.invoke_anonymous_httptrigger(url=url,
method="GET",
body="anything".encode(encoding='utf-8'),
headers={"k1": "v1", "k2": "v2"})
```
+ Integration with your own http_client
```python
import requests
import os
from alibabacloud_fc_open20210406.client import Client
from alibabacloud_tea_openapi import models as open_api_models
ak = os.getenv('ak')
sk = os.getenv('sk')
url = os.getenv('url')
client = Client(config=open_api_models.Config(access_key_id=ak,
access_key_secret=sk,
region_id='cn-hangzhou'))
# build your own request
req = requests.Request(
url=url,
method='GET'
)
req = client.sign_request(req)
with requests.Session() as s:
prep=s.prepare_request(req)
resp = s.send(prep)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/aliyun/alibabacloud-gateway",
"name": "alibabacloud-gateway-fc-util",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "alibabacloud,gateway,fc,util",
"author": "Alibaba Cloud SDK",
"author_email": "sdk-team@alibabacloud.com",
"download_url": "https://files.pythonhosted.org/packages/a2/a0/b4d0bbb2ffd3fbcf2a5644d21cd5152d058f83e11489dd1c4b4e680230f8/alibabacloud_gateway_fc_util-0.0.4.tar.gz",
"platform": "any",
"description": "## README\n\n### Installation\n\n+ install with `pip` tool.\n\n```bash\n# install alibabacloud_fc_open20210406\npip install -U alibabacloud_fc_open20210406\n```\n\n### Usage\n\n+ Invoke HTTP Trigger\n\n```python\n# -*- coding: utf-8 -*-\nimport os\n\nfrom alibabacloud_fc_open20210406.client import Client\nfrom alibabacloud_tea_openapi import models as open_api_models\n\nak = os.getenv('ak')\nsk = os.getenv('sk')\nurl = os.getenv('url')\n\nclient = Client(config=open_api_models.Config(access_key_id=ak,\n access_key_secret=sk,\n region_id='cn-hangzhou'))\n\nresp = client.invoke_httptrigger(url=url,\n method=\"GET\", \n body=\"anything\".encode(encoding='utf-8'),\n headers={\"k1\": \"v1\", \"k2\": \"v2\"})\n```\n\n+ Invoke Anonymous HTTP Trigger\n\n```python\nimport os\n\nfrom alibabacloud_fc_open20210406.client import Client\nfrom alibabacloud_tea_openapi import models as open_api_models\n\nak = os.getenv('ak')\nsk = os.getenv('sk')\nurl = os.getenv('url')\n\nclient = Client(config=open_api_models.Config(access_key_id=ak,\n access_key_secret=sk,\n region_id='cn-hangzhou'))\n\nresp = client.invoke_anonymous_httptrigger(url=url,\n method=\"GET\", \n body=\"anything\".encode(encoding='utf-8'),\n headers={\"k1\": \"v1\", \"k2\": \"v2\"})\n\n\n```\n\n\n+ Integration with your own http_client\n\n```python\n\nimport requests\nimport os\n\nfrom alibabacloud_fc_open20210406.client import Client\nfrom alibabacloud_tea_openapi import models as open_api_models\n\nak = os.getenv('ak')\nsk = os.getenv('sk')\nurl = os.getenv('url')\n\nclient = Client(config=open_api_models.Config(access_key_id=ak,\n access_key_secret=sk,\n region_id='cn-hangzhou'))\n\n# build your own request\nreq = requests.Request(\n url=url,\n method='GET'\n)\nreq = client.sign_request(req)\nwith requests.Session() as s:\n prep=s.prepare_request(req)\n resp = s.send(prep)\n\n```",
"bugtrack_url": null,
"license": "Apache License 2.0",
"summary": "Alibaba Cloud FC Util Library for Python",
"version": "0.0.4",
"split_keywords": [
"alibabacloud",
"gateway",
"fc",
"util"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a2a0b4d0bbb2ffd3fbcf2a5644d21cd5152d058f83e11489dd1c4b4e680230f8",
"md5": "42c98ec44a60ff48e45d37396ab490d3",
"sha256": "2d4409cf3b3ce280f7d9d4c1c0e770f5b72f8d1beabc877ba66bb10721e44b57"
},
"downloads": -1,
"filename": "alibabacloud_gateway_fc_util-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "42c98ec44a60ff48e45d37396ab490d3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 4417,
"upload_time": "2023-04-10T13:03:58",
"upload_time_iso_8601": "2023-04-10T13:03:58.940363Z",
"url": "https://files.pythonhosted.org/packages/a2/a0/b4d0bbb2ffd3fbcf2a5644d21cd5152d058f83e11489dd1c4b4e680230f8/alibabacloud_gateway_fc_util-0.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-10 13:03:58",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "aliyun",
"github_project": "alibabacloud-gateway",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "alibabacloud-gateway-fc-util"
}