This is a migrated thread and some comments may be shown as answers.

Sending multiple parameters to REST service created with wizard using POS

2 Answers 46 Views
Web Services
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Awni
Top achievements
Rank 1
Awni asked on 12 Apr 2012, 05:21 PM
    protected DispatchOADomainModel.Call OnUpdateItem(string id, DispatchOADomainModel.Call newValue)
        {
            try
            {
                this.dataManager.UpdateEntity(newValue);
                return newValue;
            }
            catch (OpenAccessException)
            {
                throw new Exception(Convert.ToString(HttpStatusCode.BadRequest));
            }
        }

2 Answers, 1 is accepted

Sort by
0
Zoran
Telerik team
answered on 17 Apr 2012, 12:52 PM
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.  

All the best,
Zoran
the Telerik team
Telerik OpenAccess ORM Q1 2012 release is here! Check out what's new or download a free trial >>
0
Awni
Top achievements
Rank 1
answered on 24 Apr 2012, 05:33 PM
hi,
Thanks for the reply, issue RESOLVED. 
I re-read the code generated by the wizard and it uses PUT method for Update, not POST. My bad, sorry :)

For reference, when sending an id as a parameter, the correct format does not contain the word "id", it's just:
http://localhost/Disp/Calls.svc/2930?format=json 
2930 being the id here. 


thanks again and keep up the good work! 

Regards,
awni
Tags
Web Services
Asked by
Awni
Top achievements
Rank 1
Answers by
Zoran
Telerik team
Awni
Top achievements
Rank 1
Share this question
or