-1

I've built a restAPI using Flask and tested it in local device. I want to host server in my local device(my desktop) and want to send request from another device(my laptop).

Searching for this gave me lots of resources on how to host server on a platform or on internet. I just want to test before hosting it elsewhere.

EDIT:

from my laptop:

path = f'http://{hosted_server_ip}:{hosted_server_port}/{endpoint}'
requests.post(path, json=input_data)

outputting ConnectionRefusedError

haneulkim
  • 4,406
  • 9
  • 38
  • 80

1 Answers1

1
  1. For this you first need both the laptops connected to same WiFi (or any other local network)

  2. Then use your desktop IP address assigned by the router (in place of localhost in url)

To find out the IP address of your system:-

  1. Type into the command line ipconfig (Windows)
  2. There's going to be a bunch of IP's
  3. Try all of them except 127.0.0.1
HarshVagh
  • 11
  • 1