So, I Have REST URL to register like this :
http://localhost:8080/task_manager/v1/register
And then, I try the URL in Google Chrome Advanced Rest Client. Everything goes smoothly.
And now I decided to test the URL on another computer. So I copy paste the file to another computer and test the URL once again.
But the result is I got 404 ERROR, Object not found.
Did I hit something wrong ? I copy all the file correctly. This is weird.
UPDATE : I use all the folder which contains all the files and I using same version of XAMPP & PHP on that both computers
Localhost targets on your computer, means the actual machine the files are on. If you are using php > 5.3 you can use php's build in development server with
php -S __YOUR LOCAL IP__ : 8000
and access the site from all the computers within your network
For example, if you run
php -S 192.168.0.1:8000
on your development machine, you can access it via
http://192.168.0.1:8000/
from every device connected to your local network
As you have written in your comment you have copied all the files, it is most likely that you either don't have php, apache or a webserver (MAMP,WAMP,...) installed (or started) on the other machine, or you just didn't copy the files to the correct folder.
an url beginning with localhost
refers to the computer where it's called from. See wikipedia localhost .
To provide the same behavior on another computer you need to copy the whole project and install the used server software eg apache, mysql etc. pp. or access the project from another computer in the same network using the internal network IP instead of localhost.
FYI: localhost is almost the same like the loop-IP 127.0.0.127
so on the computer where it works there should also work: http://127.0.0.127:8080/task_manager/v1/register
Now replace the 127.0.0.127
with the IP of your computer when testing it on another computer
您需要在本地服务器等网络服务器上运行项目。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.