Sending multiple parameters to REST service created with wizard using POST

Thread is closed for posting
2 posts, 0 answers
  1. Awni
    Awni avatar
    3 posts
    Member since:
    Apr 2012

    Posted 12 Apr 2012 Link to this post

    Sending multiple parameters to REST service created with wizard using POST   
    I used the wizard to generate a WCF REST service, and the following is one of the generated methods. 
    I am trying to call this method, but not sure how to sending multiple parameters. I am testing with fiddler.
    Here is a Call object that I have successfully sent to the OnAddItem(also generated by the wizard):
    {"AccountId":"2012328001","CallCreated":"\/Date(1334214000000-0700)\/","CallStatus":"AC","CarNumber":"","CustomerName":"not AMANDA","CustomerPhone":"941.302.8611","DropoffAddress":"home","DropoffCity":"sarasotta","DropoffDate":"\/Date(00000-000)\/","DropoffState":"fl","DropoffZIP":"88449","Fare":-1,"Id":"2933","MilesDriven":-1,"PickupAddress":"55 north Madison st","PickupCity":"sarasotta","PickupDate":"\/Date(00-000)\/","PickupState":"FL","PickupZIP":"88333","Rate":0,"TravelTime":"0:00","TravelTimeTimeSpan":-1}
    protected DispatchOADomainModel.Call OnUpdateItem(string id, DispatchOADomainModel.Call newValue)
                    return newValue;
                catch (OpenAccessException)
                    throw new Exception(Convert.ToString(HttpStatusCode.BadRequest));
    How can I send the 2 paramters: id and newValue using POST method?
    Thank you in advance,
  2. Zoran
    Zoran avatar
    534 posts

    Posted 17 Apr 2012 Link to this post

    Hi Awni,

     Can you try passing the Id parameter in the query string of the URI that you are sending the Http POST request to. The URI should contains something like: http://localhost/yourrestserviece/updatecalls?id=3. 

    Kind regards,
    the Telerik team
    Telerik OpenAccess ORM Q1 2012 release is here! Check out what's new or download a free trial >>
Back to Top