Skip to content

Commit f8692d8

Browse files
authored
Merge pull request #1561 from fermyon/docs/fwf-http-trigger-doc
docs(functions): add http trigger doc, request header info
2 parents b69f5c7 + f6a91ad commit f8692d8

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
title = "HTTP Trigger Reference"
2+
template = "functions_main"
3+
date = "2025-07-11T00:00:00Z"
4+
enable_shortcodes = true
5+
6+
---
7+
- [HTTP Requests](#http-requests)
8+
- [Request Headers](#request-headers)
9+
10+
Fermyon Wasm Functions currently supports the [`http` trigger type](https://spinframework.dev/v3/http-trigger) for Spin applications.
11+
12+
# HTTP Requests
13+
14+
Here we'll cover details around the inbound HTTP request received by an application (or a specific component) when running on Fermyon Wasm Functions.
15+
16+
## Request Headers
17+
18+
In addition to any headers passed by the client making the request to an application, there are several Spin-related headers included in the request passed to your component.
19+
20+
> Each of the headers below link to upstream Spin documentation, where more details and examples can be seen.
21+
22+
- [`spin-full-url`](https://spinframework.dev/v3/http-trigger#additional-request-information-spin-full-url): The full URL of the request. This includes full host and scheme information.
23+
- [`spin-path-info`](https://spinframework.dev/v3/http-trigger#additional-request-information-spin-path-info): The request path relative to the component route
24+
- [`spin-path-match-n`](https://spinframework.dev/v3/http-trigger#additional-request-information-spin-path-match-n): (Conditionally included): Where n is the pattern for a single-segment wildcard value (e.g. spin-path-match-userid will access the value in a URL containing a route that includes :userid)
25+
- [`spin-matched-route`](https://spinframework.dev/v3/http-trigger#additional-request-information-spin-matched-route): The part of the trigger route that was matched by the route (including the wildcard indicator if present)
26+
- [`spin-raw-component-route`](https://spinframework.dev/v3/http-trigger#additional-request-information-spin-raw-component-route): The component route pattern matched, including the wildcard indicator if present
27+
28+
Other headers of interest that can be utilized by the triggered component are seen below:
29+
30+
- `true-client-ip`: The IP of the client sending the request (e.g. "151.49.93.60")

templates/functions_sidebar.hbs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@
5353
<a {{#if (active_content request.spin-path-info "/wasm-functions/aka-command-reference" )}} class="active"
5454
{{/if}} href="{{site.info.base_url}}/wasm-functions/aka-command-reference">The <code>aka</code> Command
5555
Reference</a>
56+
<a {{#if (active_content request.spin-path-info "/wasm-functions/http-trigger-reference" )}} class="active"
57+
{{/if}} href="{{site.info.base_url}}/wasm-functions/http-trigger-reference">HTTP Trigger
58+
Reference</a>
5659
<a {{#if (active_content request.spin-path-info "/wasm-functions/changelog" )}} class="active" {{/if}}
5760
href="{{site.info.base_url}}/wasm-functions/changelog">Changelog</a>
5861
<a {{#if (active_project request.spin-full-url "/wasm-languages/webassembly-language-support" )}} class="active"

0 commit comments

Comments
 (0)