I wont got into much detail about the code of my device, but here the idea
Here are what i'm trying to do:
1 - Device reboot
2 - Device notify the agent that he need his configuration json
3 - Agent do a POST to my website
4 - my website receive the POST from the agent and dig into my DB to get the configuration for that device
5 - my website compose a json with whats in the DB and send it back to the agent
6 - my agent validate that the json is in the correct format and send it to the device
Everyone is happy.
I have a website that, when I visit it with a web browser, it does step 4-5-6
I have an device/agent that does step 1-2
I'm not able to do step 3, let say my website is : potato.com
when I use Chrome and go to Potato, the php script on Potato do what it have to doo
but how can I use the AGENT to do like if its visiting potato.com ?