You should look at a library called Guzzle this will help you make requests like this in a much easier to understand way than using cURL in it's raw format. For example you will be able to pass Guzzle an array containing your fields and it will stick it all into a string for you!
HTTP Request to API
Hi,
This is not specifically Laravel related question so I apologize for it in advance.
I'm in a quite confusing situation. I'm supposed to make a HTTP request to the following API -
The message parameter should container username and password.
What I want to do is send a HTTP POST request to the URL when my form is submitted. Now I don't know how I can make this in cURL because I don't see any option to set CURL_POSTFIELDS method in the URL, neither can I use http_build_query method.
The API is hosted on a JBOSS application server. I'm using PHP to communicate with the API.
I'm quite confused. So any sort of suggestion would go a long way.
Thank you.
Please or to participate in this conversation.

