<commit_before>.. meta::
    :author: Cask Data, Inc.
    :description: HTTP RESTful Interface to the Cask Data Application Platform
    :copyright: Copyright © 2014 Cask Data, Inc.

.. _http-restful-api-service:

===========================================================
Service HTTP RESTful API
===========================================================

.. highlight:: console

This interface supports making requests to the methods of an Application’s Services.
See the `CDAP Client HTTP API <#cdap-client-http-api>`__ for how to control the life cycle of
Services.

Requesting Service Methods
--------------------------
To make a request to a Service's method, send the method's path as part of the request URL along with any additional
headers and body.

The request type is defined by the Service's method::

  <REQUEST-TYPE> <base-url>/apps/<app-id>/services/<service-id>/methods/<method-id>

.. list-table::
   :widths: 20 80
   :header-rows: 1

   * - Parameter
     - Description
   * - ``<REQUEST-TYPE>``
     - One of GET, POST, PUT and DELETE. This is defined by the handler method.
   * - ``<app-id>``
     - Name of the Application being called
   * - ``<service-id>``
     - Name of the Service being called
   * - ``<method-id>``
     - Name of the method being called

HTTP Responses
..............
.. list-table::
   :widths: 20 80
   :header-rows: 1<commit_msg>Fix link to lifecycle documentation. Fix description of method endpoint for services. (https://issues.cask.co/browse/CDAP-726)<commit_after>.. meta::
    :author: Cask Data, Inc.
    :description: HTTP RESTful Interface to the Cask Data Application Platform
    :copyright: Copyright © 2014 Cask Data, Inc.

.. _http-restful-api-service:

===========================================================
Service HTTP RESTful API
===========================================================

.. highlight:: console

This interface supports making requests to the methods of an Application’s Services.
See the :ref:`http-restful-api-lifecycle` for how to control the life cycle of
Services.

Requesting Service Methods
--------------------------
To make a request to a Service's method, send the method's path as part of the request URL along with any additional
headers and body.

The request type is defined by the Service's method::

  <request-type> <base-url>/apps/<app-id>/services/<service-id>/methods/<method-endpoint>

.. list-table::
   :widths: 20 80
   :header-rows: 1

   * - Parameter
     - Description
   * - ``<request-type>``
     - One of GET, POST, PUT and DELETE. This is defined by the handler method.
   * - ``<app-id>``
     - Name of the Application being called
   * - ``<service-id>``
     - Name of the Service being called
   * - ``<method-endpoint>``
     - Endpoint path matching the handler method's annotation

HTTP Responses
..............
.. list-table::
   :widths: 20 80
   :header-rows: 1
{'fraction_non_alphanumeric': 0.2053048570444368, 'fraction_numerical': 0.010678608336203927, 'mean_word_length': 3.1664275466284075, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 22, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6438759', 'n_tokens_mistral': 845, 'n_tokens_neox': 775, 'n_words': 306}