this api method should create something then return some data to the user

it works fine but returns status code 200 , i want it to return 201 (created)

how can i do that ?

thanks

public CResponseBase Put([FromBody] CNewCampaignRequest i_request_obj)
{
    CResponseBase o_response = new CResponseBase();

    int account_id = CAPILogin.AccountIDGet(i_request_obj.UserName, i_request_obj.Password);

    if (account_id != -1)
    {
        switch (i_request_obj.ActionName)
        {
            case "CampaignFromURLCreate":
                o_response = CampaignFromURLCreate(account_id, i_request_obj);
                break;
            default:
                break;
        }
    }

    return o_response;
}

Related posts

Recent Viewed