// This module is included in the following assemblies:
// as_triggering-integrations-with-http-requests.adoc

[id='how-requests-are-handled_{context}']
= How {prodname} handles HTTP requests

You can specify an HTTP `GET` or `POST` request to trigger execution of
a simple integration. Although a `GET` request usually obtains data and a
`POST` request usually updates data, you can use either request  
to trigger an integration that does either operation. Any parameters 
in the request are available for mapping to data fields in the
next connection that is in the integration. For details, see
link:{LinkSyndesisIntegrationGuide}#about-json-schema-for-http-requests_webhook[About the JSON schema for specifying request parameters]. 

A Webhook connection only passes the data it receives to
the next connection in the integration. 
When {prodname} receives an HTTP request, it:

* Returns an HTTP status header to the requester. When a request successfully
triggers execution of an integration, the {prodname} return code is `201`.
When a request fails to trigger execution of an integration, the {prodname}
return code is `5xx`. 
* Does not return any other data to the requester. In other words, there is 
no data in the HTTP body of the response that contains the status header.
* Passes the data in the request to the next connection in the integration. 

This means that you can define a simple integration that is triggered by
a `GET` request and that updates data rather than obtaining data. 
Likewise, you can define a simple integration that is triggered by a `POST` request 
and that obtains data rather than updating data.

[NOTE]
====
In the integration's *Activity* tab, the status of a webhook step is `Success` every time. This `Success` status indicates the status of the communication between the {prodname}} Webhook and the HTTP client that invokes it. This `Success` status is not an indication that the integration passed successfully nor that any steps are without error. Errors generated by HTTP requests are not visible in the integration’s *Activity* log.
 
When you configure a webhook, the *Include error message in the return body* option is checked by default. When this option is checked, to verify whether the errors generated by HTTP requests are included in the webhook response, send a test request that will generate an error and then check the response header. You can also check the integration pod’s log for `INFO` messages. Use the following command to view the integration’s pod log, where `example-integration-pod` is the name of the pod.

----
oc logs -f pod/example-integration-pod
----
====
