Loading ...
Sorry, an error occurred while loading the content.

Computation and PUT vs GET

Expand Messages
  • scottgregory@yahoo.com
    Hello Thinking of a REST interface to a trading system. I can get my head around GET /trades to get a list of trades GET /trade/123 to retrieve a specific
    Message 1 of 4 , Feb 1, 2005
    • 0 Attachment
      Hello

      Thinking of a REST interface to a trading system.

      I can get my head around
      GET /trades
      to get a list of trades
      GET /trade/123
      to retrieve a specific trade, and even
      PUT /trade/987
      to create a new trade, assuming user has appropriate permissions.

      What about providing a 'remote' pricing facility? Using SOAP, we
      would have a 'service' which returned a value upon accepting a trade
      Value priceMe(SomeTrade)

      How to do this RESTfully?
      Presuming that the pricing engine is stateless, a GET with a payload
      would work?
      What else am I missing - how better to do this?

      Thanks!
      sdg
    • Hugh Winkler
      ... Gack! You ought not send an entity in a GET. How about POSTing your trade to some URI, and the server returns the URI of the resource containing your price
      Message 2 of 4 , Feb 1, 2005
      • 0 Attachment
        >What about providing a 'remote' pricing facility?  Using SOAP, we
        >would have a 'service' which returned a value upon accepting a trade
        >Value priceMe(SomeTrade)

        >How to do this RESTfully?
        >Presuming that the pricing engine is stateless, a GET with a payload
        >would work?

        Gack! You ought not send an entity in a GET.

        How about POSTing your trade to some URI, and the server returns the
        URI of the resource containing your price in the response Location
      • Jan Algermissen
        Scott, ... What about GET /pricingService?trade=http://example.org/trade/123 or POST /pricingService
        Message 3 of 4 , Feb 1, 2005
        • 0 Attachment
          Scott,

          scottgregory@... wrote:

          >
          >Hello
          >
          >Thinking of a REST interface to a trading system.
          >
          >I can get my head around
          >GET /trades
          >to get a list of trades
          >GET /trade/123
          >to retrieve a specific trade, and even
          >PUT /trade/987
          >to create a new trade, assuming user has appropriate permissions.
          >
          >What about providing a 'remote' pricing facility? Using SOAP, we
          >would have a 'service' which returned a value upon accepting a trade
          > Value priceMe(SomeTrade)
          >
          >
          What about

          GET /pricingService?trade=http://example.org/trade/123

          or

          POST /pricingService

          <pricing>
          <trade><!-- representation of trade goes here --></trade>
          <value/>
          </prcing>

          Reply:

          HTTP 200 OK

          <pricing>
          <trade><!-- representation of trade goes here --></trade>
          <value>VALUE FILLED IN BY SERVICE</value>
          </prcing>


          Jan


          >How to do this RESTfully?
          >Presuming that the pricing engine is stateless, a GET with a payload
          >would work?
          >What else am I missing - how better to do this?
          >
          >Thanks!
          >sdg
          >
          >
          >
          >
          >
          >
          >
          >
          >
          >Yahoo! Groups Links
          >
          >
          >
          >
          >
          >
          >
          >
          >
          >


          --
          Jan Algermissen
          Consultant & Programmer
          http://jalgermissen.com
        • m_covas
          I think that you should consider the pricing as a subordinate resource of a trade. First, you POST a new trade under /trades by sending some
          Message 4 of 4 , Mar 1 5:46 AM
          • 0 Attachment
            I think that you should consider the pricing as a subordinate
            resource of a trade.

            First, you POST a new trade under
            <some_prefix>/trades
            by sending some document which contains the relevant data for the
            trade. You get an ID
            Then you issue a GET (With perhaps some restrictions in the query
            string) to
            <some_prefix>/trades/<ID>/pricing
            and get a document which describes the trade and its pricing.

            You can further issue a PUT to
            <some_prefix>/trades/<ID>/status
            (So you can avoid sending the full trade description)
            to activate the trade, i.e. send it to some electronic market or
            whatever...

            M. Covas
          Your message has been successfully submitted and would be delivered to recipients shortly.