I initially thought there may be an error in my code, but I have done further tests where I am getting strange behaviour, and I was hoping to discover why. So I have a simple API route
Route::group(['prefix' => 'api/v1'], function () { Route::post('createProject', ['uses' => 'ProjectAPIController@createProject']); }); This calls a function that simply returns a success messsage
public function createProject(Request $request) { return response()->json(["Success", 200]); } The application I built to use this API was getting a bad request response, so I moved into Postman.
Now within Postman, if I do a Post request to this route, and I pass JSON via the body, I see the bad request still. However, if I change the JSON setting to text, I see the Success reponse. As such, I have discovered that the API for some reason is no longer liking JSON being sent to it.
Is there any reason this may be happening?
Thanks