{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "ec2c53de-6bb0-4358-9eb4-e7b7301877df",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(<bound method Response.json of <Response [200]>>, <Response [200]>)"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import requests\n",
    "url = 'http://localhost:10087/processing_limit_power_by_machines'\n",
    "data = {\n",
    "    'col_rp': '实际功率',\n",
    "    'col_tp': '理论功率',\n",
    "    'mongodb_connection': 'mongodb://root:Jydl3377@192.168.1.33:27017',\n",
    "    'mongodb_database': 'algorithm_platform',\n",
    "    'mongodb_read_table': 'J00260NWP_agcavc',\n",
    "    'mongodb_write_table': 'J00260NWP_machines',\n",
    "    # 添加其他参数\n",
    "}\n",
    "response = requests.post(url, data) \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "5723d8bf-5711-45c0-a9e6-4649061d7c55",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'args': {'col_rp': '实际功率',\n",
       "  'col_tp': '理论功率',\n",
       "  'mongodb_connection': 'mongodb://root:Jydl3377@192.168.1.33:27017',\n",
       "  'mongodb_database': 'algorithm_platform',\n",
       "  'mongodb_read_table': 'J00260NWP_agcavc',\n",
       "  'mongodb_write_table': 'J00260NWP_machines'},\n",
       " 'end_time': '2024-09-27 11:30:00',\n",
       " 'start_time': '2024-09-27 11:29:52',\n",
       " 'success': 1}"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import json  \n",
    "\n",
    "parsed_json = json.loads(response.text)\n",
    "parsed_json"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "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.9.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
