{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "89981521",
   "metadata": {},
   "outputs": [],
   "source": [
    "import requests"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "84259d1b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'predict': '0', 'p0': '0.9678631914548343', 'p1': '0.0321368085451656'}"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "params = {\"RevolvingUtilizationOfUnsecuredLines\":0.88551908,\n",
    "          \"age\":43,\n",
    "          \"NumberOfTime30_59DaysPastDueNotWorse\":0,\n",
    "          \"DebtRatio\":0.177512717,\n",
    "          \"MonthlyIncome\":5700.0,\n",
    "          \"NumberOfOpenCreditLinesAndLoans\":4,\n",
    "          \"NumberOfTimes90DaysLate\":0,\n",
    "          \"NumberRealEstateLoansOrLines\":0,\n",
    "          \"NumberOfTime60_89DaysPastDueNotWorse\":0,\n",
    "          \"NumberOfDependents\":0.0}\n",
    "\n",
    "response = requests.get('http://127.0.0.1:8080/', json=params)\n",
    "response.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "981b4236",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\r\n",
      "    \"predict\": \"0\",\r\n",
      "    \"p0\": \"0.9678631914548343\",\r\n",
      "    \"p1\": \"0.0321368085451656\"\r\n",
      "}\r\n"
     ]
    }
   ],
   "source": [
    "!curl  -X  'GET'  'http://127.0.0.1:8080/'   -H 'Content-Type: application/json' \\\n",
    "  -d   '{\"RevolvingUtilizationOfUnsecuredLines\":0.88551908,\"age\":43, \\\n",
    "         \"NumberOfTime30_59DaysPastDueNotWorse\":0,\"DebtRatio\":0.177512717, \\\n",
    "         \"MonthlyIncome\":5700.0,\"NumberOfOpenCreditLinesAndLoans\":4, \\\n",
    "         \"NumberOfTimes90DaysLate\":0, \"NumberRealEstateLoansOrLines\":0, \\\n",
    "         \"NumberOfTime60_89DaysPastDueNotWorse\":0, \"NumberOfDependents\":0.0}'"
   ]
  }
 ],
 "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.10.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
