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

amidabrian's avatar

submitting a Post request to an API.

I am a bit stuck here as I know how to create a new item for an Api using tinker or Sequel Pro. How would you go about storing a new item? Using something like Postman or curl. Any help or direction would be appreciated.

0 likes
1 reply
tykus's avatar

By convention you make a POST request to a URI to create the new resource, this is not the same as tinker and Sequel Pro.

Make sure your app has a route definition which can respond to the request:

// routes/api.php
Route::post('users', 'UsersController@store');

In Postman, you change the method to POST and enter the URI http://your.domain.com/api/users and add a body which can be form data, raw application/json etc.; any of which will essentially be sending key-value pairs with the request.

Please or to participate in this conversation.