Issue when sending Parameters update by postman put method Web Api?

I work on .net core 6.0 web api . i face issue on

testing web api by post man .

my issue how to send paramters to web api update

method .

so How to send id with object on body to update action .

    "itemId": 4,
    "itemNameAR": "قلم",
    "itemNameEN": "pen2",
    "costTypeId": 1,
    "minLimitQunatity": 1,
    "costAccountID": 1,
    "departmentID": 1,
    "itemCategoryId": 1,
    "description": "1",
    "hasExpireDate": true,
    "isActive": true,
    "createdBy": 1,
    "modifiedBy": 1,
    "createdDate": "0001-01-01T00:00:00",
    "modifiedDate": "0001-01-01T00:00:00",
    "itemattribute": null

when send api as below


so How to solve issue please ?

          public async Task<IActionResult> Update(int id, UpdateItemCommand command)
              if (id != command.Id)
                  return BadRequest();
              return Ok(await Mediator.Send(command));

what i try to send api request Web Api Not catched or hitted although i run my web api .

Api not hit

Updated post
i change url on post man as below


but still issue not solved

error display 400 bad request
details error

    "errors": {
        "Fax": [
            "The Fax field is required."
        "City": [
            "The City field is required."
        "Phone": [
            "The Phone field is required."
        "Region": [
            "The Region field is required."
        "Address": [
            "The Address field is required."
        "Country": [
            "The Country field is required."
        "PostalCode": [
            "The PostalCode field is required."
        "ContactName": [
            "The ContactName field is required."
        "ContactTitle": [
            "The ContactTitle field is required."
        "CustomerName": [
            "The CustomerName field is required."
    "type": "",
    "title": "One or more validation errors occurred.",
    "status": 400,
    "traceId": "00-efde167cb6a7fa5af42abff9d055e2db-92ff55a318cb7a29-00"

>Solution :

Change your request URL to,


because your controller has been configured as,


which indicates a path parameter rather than query parameter.

Leave a Reply