After successfully testing a POST request to add a new entity to the database from my project back-end using Postman, I encountered an error when trying to do the same from the front UI (I'm using Angular 4): Required request body is missing.
Failed to load resource: the server responded with a status of 500 (Internal Servlet Error)
I suspect there might be an issue with my TypeScript code. Can anyone assist me with this?
<form (ngSubmit)="createEntity()">
<div class="form-group">
<label for="code">Code</label>
<input type="text" [(ngModel)]="code" placeholder="Code" name="code" class="form-control" id="code">
</div>
<div class="form-group">
<label for="description">Description</label>
<input [(ngModel)]="description" placeholder="Description" name="description" class="form-control" id="description">
</div>
<div class="form-group">
<label for="type">Type</label>
<p-dropdown [(ngModel)]="type" [options]="entityTypes" filter="filter" name="type" placeholder="Type" [style]="{'width':'100%'}">
</p-dropdown>
</div>
<div class="form-group">
<label for="profil">Profil</label>
<p-dropdown [(ngModel)]="profil" [options]="entityProfiles" filter="filter" name="profil" placeholder="Profil" [style]="{'width':'100%'}">
</p-dropdown>
</div>
<div class="form-group">
<label for="number">Number</label>
<input [(ngModel)]="number" placeholder="Number" name="number" class="form-control" id="number">
</div>
<button type="submit" class="btn btn-success">Submit</button>
</form>
Thank you in advance :)