{ "cells": [ { "cell_type": "code", "id": "initial_id", "metadata": { "collapsed": true, "ExecuteTime": { "end_time": "2025-07-24T07:48:19.772394Z", "start_time": "2025-07-24T07:48:19.421609Z" } }, "source": [ "import requests\n", "\n", "headers = {\n", " 'content-type': 'application/json',\n", "}\n", "\n", "json_data = {\n", " 'email': 'sunyulei@f6car.com',\n", " 'password': 'ff123456',\n", "}\n", "\n", "response = requests.post('https://f6car.udesk.cn/open_api_v1/log_in', headers=headers, json=json_data)\n", "\n", "# Note: json_data will not be serialized by requests\n", "# exactly as it was in the original request.\n", "#data = '\\n{\\n \"email\": \"admin@udesk.cn\",\\n \"password\": \"password\"\\n}'\n", "#response = requests.post('https://demo.udesk.cn/open_api_v1/log_in', headers=headers, data=data)\n" ], "outputs": [], "execution_count": 3 }, { "metadata": { "ExecuteTime": { "end_time": "2025-07-24T07:48:21.898679Z", "start_time": "2025-07-24T07:48:21.894034Z" } }, "cell_type": "code", "source": "print(response.text)", "id": "b02f5b8523219e9e", "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "{\"code\":1000,\"open_api_auth_token\":\"3d39984e-2677-42a8-bc2b-cfd0eb03c45f\"}\n" ] } ], "execution_count": 4 } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.6" } }, "nbformat": 4, "nbformat_minor": 5 }