In part of my PHP application, I need to make an REST style API call and continue working. I don't care about the result of the API call (so I don't need to see the return value) but I do need to be able to just fire it off and continue working.
If I use file_get_contents()
to do this, then it will wait until the url returns. I can set a timeout in CURL but the smallest timeout it allows is one second so this is not very useful. I have looked for other options in CURL but I haven't found anything yet.
Since I have written this part of the API that is being hit I am currently having it just return immediately and continue working in that code but in the future if I talk to other external APIs then I will need to know how to do this and it just seems like better practice not to depend on some external code to have your script continue working. It probably isn't very normal to request a URL and not care about what comes back but this is what I need! Anyone know how?