Night Walker
Night Walker

Reputation: 21280

transforming RPC API to Rest API

I am started playing with REST, and trying to understand how I can map following RPC style Web Method to REST style.

public PerformanceResponse GetPerformance(int lineId, int maxNumberOfEntries, bool ascending)

This is the only operation I have related to Performance and it just extracts some information from DB.

Thanks for assistance.

Upvotes: 1

Views: 304

Answers (2)

Aliostad
Aliostad

Reputation: 81680

Here is how I would design the API:

  • Create a PerformanceController
  • Have a Get method with parameters you had
  • Design URL to be /Performance/{lineId}?maxNumberOfEntries={max}&ascending={asc}

Upvotes: 1

LosManos
LosManos

Reputation: 7692

Is

http://example.com/Performance/1/2/0

where 1 is lineID, 2 is maxNumber and 0 is ascending

an answer?
(your question is a bit vague - please specify)

Upvotes: 0

Related Questions