Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

KhairulAlam's avatar

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 -

https://10.10.1.12:8443/HttpReceiver/HttpReceiver?destinationName=fees.school&destinationType=queue&clientid=fees.school&target=ENGINE&LoadConf=N&message=&reply=true

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.

0 likes
3 replies
slashequip's avatar

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!

1 like
aurawindsurfing's avatar

Use tool called Postman for this type of issues. I simply pasted your URL and got all the params simply extracted so I can play with it now until I get a proper response. Have a look:

And then you can create snippets from it easily as well:

Your endpoint does not seem to give any sort of responses, not even an error response so I guess that is something to look at in the first place.

Enjoy!

2 likes
KhairulAlam's avatar

Hi @aurawindsurfing, thank you for looking into it mate. There was some problem with the API. It has been fixed and it's working now. Thank you for your effort. Cheers! :)

Please or to participate in this conversation.