You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
K_SINK=https://httpbin.org/post go run cmd/http-server-producer/main.go
# in a new shell
curl -v localhost:8080/
path param to cloudevent payload
CE_TEMPLATE='{{ $name := trimPrefix "/person/" .url.path }}'\
'{'\
'"person": {{ $name | quote }}'\
'}' \
HTTP_PATH="/person/" K_SINK=https://httpbin.org/post go run cmd/http-server-producer/main.go
# in a new shell
curl -v localhost:8080/person/alex
query param to cloudevent payload
CE_TEMPLATE='{{ $query := .url.query }}'\
'{'\
'"person": {{ index (index $query "person") 0 | quote }}'\
'}' \
K_SINK=https://httpbin.org/post go run cmd/http-server-producer/main.go
# in a new shell
curl -v localhost:8080/?person=alex
request body to cloudevent payload
CE_TEMPLATE='{{ $name := .body.name }}'\
'{'\
'"person": {{ $name | quote }}'\
'}' \
HTTP_METHOD=POST \
K_SINK=https://httpbin.org/post go run cmd/http-server-producer/main.go
# in a new shell
curl -v -X POST localhost:8080/ -d '{ "name" : "Alex" }'