Difference between revisions of "Example Clients"

From Textserver wiki
Jump to: navigation, search
(Created page with "To call a TextServer service from a client program running on your side, this client needs to send the appropriate request in the right format. The request is a standard HTTP...")
 
Line 9: Line 9:
 
* Simply change the service name in the URL to access a different service. You can find out the service name at the top of the "Execute" form of your subscribed services.
 
* Simply change the service name in the URL to access a different service. You can find out the service name at the top of the "Execute" form of your subscribed services.
 
* Replace the parameters in the example client with the parametes that the called service requires (e.g. language identification service does not require a "language" parameter, but the other services do.
 
* Replace the parameters in the example client with the parametes that the called service requires (e.g. language identification service does not require a "language" parameter, but the other services do.
  All services require a "interactive" parameter, and a "text_input" (for interactive jobs) or a "input_file" parameter (for batch jobs).  
+
All services require a "interactive" parameter, and a "text_input" (for interactive jobs) or a "input_file" parameter (for batch jobs).  
  You can find out the name of the required parameters in the "Execute" form of your subscribed services.
+
You can find out the name of the required parameters in the "Execute" form of your subscribed services.

Revision as of 16:59, 19 January 2016

To call a TextServer service from a client program running on your side, this client needs to send the appropriate request in the right format.

The request is a standard HTTP POST request with a multiform part containing the same information you would submit via the web interface.

Below you'll find a list of example client programs in different programming languages.

The same code can be used to access any TextServer service with small variations:

  • Simply change the service name in the URL to access a different service. You can find out the service name at the top of the "Execute" form of your subscribed services.
  • Replace the parameters in the example client with the parametes that the called service requires (e.g. language identification service does not require a "language" parameter, but the other services do.

All services require a "interactive" parameter, and a "text_input" (for interactive jobs) or a "input_file" parameter (for batch jobs). You can find out the name of the required parameters in the "Execute" form of your subscribed services.