Accept Input to a Web Service - dummies

By Steve Suehring, Janet Valade

You can add the capability for your web services to accept input and then react based on that input, much like you’d do for a web form. For example, you might accept input to the date web service to convert a date into other formats, or you might accept a URL into the site status web service to check its status.

Prior to accepting input, you should understand a bit about two HyperText Transfer Protocol (HTTP) methods. HTTP methods are ways of interacting with a web server. Here are two primary methods used on the web:

  • GET: This request sends everything right along with the URL, and you see GET requests in the address bar of your web browser. GET requests are limited by web browsers to a certain length (the length varies depending on the browser).

  • POST: These requests send data as part of the data that gets sent to the server behind the scenes. POST requests are not limited by the web browser and are therefore appropriate for long forms or for sending large files through the web.