locked
Problem Trying to Pass DateTime Parameters in Fiddler's Composer Tab RRS feed

  • Question

  • User-1582807108 posted

    Hello All,

    I would like to ask the question of how to pass a date parameter in Fiddler's Composer Tab?

    My endpoint as shown directly below:

            [HttpPost]
            [Route("AddLease")]
            public string AddLease(DateTime startDate, DateTime endDate, int slipID, int customerID, int leaseTypeID)  
            {
                return LeaseManager.AddLease(startDate, endDate, slipID, customerID, leaseTypeID);
            }


    And the way I am trying to pass the dates (startDate and endDate) is shown below:

    http://localhost:52581/AddLease?startDate=07/24/2014&endDate=08-15-2015&slipID=1&customerID=1&leaseTypeI=1

    Currently I am getting a HTTP/1.1 404 Not Found error from Fiddler but I strongly suspect
    that it is just in the way that I am composing my dates in the Composer as I am not
    sure how to pass it there ... I know how to pass other primitive types like string and integer
    but never tried to pass dates before ..

    I tried to google it up without any luck and I am hoping someone could point me in the right
    direction ... thanks so much for all the help you could give.

    Sunday, June 21, 2015 7:22 AM

Answers

  • User1644755831 posted

    Hello ric1a,

    http://localhost:52581/AddLease?startDate=07/24/2014&endDate=08-15-2015&slipID=1&customerID=1&leaseTypeI=1

    There could be number of reasons.

    1. You have marked the method as httppost then why are you passing the values in url they should be passed in Request Body.

    2. Since it is showing HTTP/1.1 404 Not Found then that is the case you can come to date issue later check your attribute routing

    Please see: Attribute Routing in ASP.NET Web API

    Hope this helps.

    With Regards,

    Krunal Parekh

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, June 22, 2015 4:03 AM

All replies

  • User1644755831 posted

    Hello ric1a,

    http://localhost:52581/AddLease?startDate=07/24/2014&endDate=08-15-2015&slipID=1&customerID=1&leaseTypeI=1

    There could be number of reasons.

    1. You have marked the method as httppost then why are you passing the values in url they should be passed in Request Body.

    2. Since it is showing HTTP/1.1 404 Not Found then that is the case you can come to date issue later check your attribute routing

    Please see: Attribute Routing in ASP.NET Web API

    Hope this helps.

    With Regards,

    Krunal Parekh

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, June 22, 2015 4:03 AM
  • User-1582807108 posted

    Hello Krunal and thanks for your help  I really appreciate it ... and also for that well written  link ... many thanks .. have a great day

    Gratefully,
    Ric

    Monday, June 22, 2015 11:42 AM