Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Although I have wrapped countless web services in an OOP-ish way, I find it difficult to come up with a good answer to your question.</p> <p>A couple of Yahoo API examples can be found here: <a href="http://curlobjects.com/trac/browser/trunk/lib/YahooApi" rel="noreferrer">http://curlobjects.com/trac/browser/trunk/lib/YahooApi</a></p> <blockquote> <p>1 Interpreting HTTP error codes and filtering protocol errors from API errors.</p> </blockquote> <p>My base http class has an http error callback that can be overriden.</p> <blockquote> <p>2 Building URL based requests, possibly with pattern matching and token substitution.</p> </blockquote> <p>I prefer string concatenation.</p> <blockquote> <p>4 How to map an OO model to the REST model. Some requests suit static methods, e.g. getting lists, and others hang in the middle between static and instance, maybe a plain provider pattern with all static methods?</p> </blockquote> <p>Sometime you need one big static factory/provider, sometimes you want a class for each method, sometimes a class for each group of related methods... There really isn't one proper way to go about this. I always spend some time getting a feel of the service's structure and then try to find an elegant way to abstract the repetitive parts.</p> <p>If you have any more specific questions regarding login forms, cookies, etc, I'd be glad to answer them.</p> <p>Edit:</p> <p>HttpWebRequest was mentioned and I'm guessing you either need to set the <a href="http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.clientcertificates.aspx" rel="noreferrer">ClientCertificate property</a> and use SSL properly, or you can <a href="http://www.west-wind.com/weblog/posts/48909.aspx" rel="noreferrer">ignore all SLL errors</a> with a CertificatePolicy.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload