{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "23e41b24", "metadata": {}, "outputs": [], "source": [ "from requests import get,post\n", "import time\n", "ip = \"http://192.168.0.209:8101\"\n", "param = {\n", " \"username\": \"tangchao\",\n", " \"password\": \"123456a\",\n", " \"client_id\": \"client\",\n", " \"grant_type\": \"password\",\n", " \"client_secret\": \"123456\",\n", "}\n", "data = get(url=f\"http://band.hxzhxy.cn/oauth/token?username=zhongwei&password=123456a&client_id=client&grant_type=password&client_secret=123456\").json()\n", "token = data[\"access_token\"]\n", "header = {\n", " \"content-type\": \"application/json\",\n", " \"authorization\": f\"Bearer {token}\",\n", "}" ] }, { "cell_type": "code", "execution_count": 2, "id": "5cba7a19", "metadata": {}, "outputs": [], "source": [ "from faker import Faker\n", "fake = Faker('zh_CN')" ] }, { "cell_type": "code", "execution_count": 3, "id": "0df311dc", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'刘想'" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "fake.name()" ] }, { "cell_type": "code", "execution_count": null, "id": "3f35dc8b", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "base", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.4" } }, "nbformat": 4, "nbformat_minor": 5 }