Comments (5)
BTW, you are right, the README is not correct and should specify the content type as well. Thanks for pointing this out.
from webhookd.
Here's the verbose output from curl:
% curl -d @test.json http://***.amazonaws.com:8080/shoebox-test -u aaron:****** -v
* Trying ***:8080...
* Connected to ******.compute-1.amazonaws.com (***) port 8080 (#0)
* Server auth using Basic with user 'aaron'
> POST /shoebox-test HTTP/1.1
> Host: ec2-44-202-194-148.compute-1.amazonaws.com:8080
> Authorization: ******
> User-Agent: curl/7.79.1
> Accept: */*
> Content-Length: 29
> Content-Type: application/x-www-form-urlencoded
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Access-Control-Allow-Headers: Accept, Content-Type, Content-Length, Accept-Encoding, Authorization
< Access-Control-Allow-Methods: *
< Access-Control-Allow-Origin: *
< Cache-Control: no-cache
< Connection: keep-alive
< X-Content-Type-Options: nosniff
< X-Hook-Id: 13
< X-Request-Id: 1666192709856983487
< Date: Wed, 19 Oct 2022 15:18:29 GMT
< Content-Type: text/plain; charset=utf-8
< Transfer-Encoding: chunked
<
Starting background job
Hook information: name=shoebox-test, id=13, method=POST
Query parameter: foo=
Header parameter: user-agent=curl/7.79.1
Script parameters:
Background job started.
* Connection #0 to host ***.compute-1.amazonaws.com left intact
from webhookd.
By switching to debug level = DEBUG, I confirmed that the payload is getting to the server:
INF 2022/10/19 15:49:50.920017 hook shoebox-test#1 started...
DBG 2022/10/19 15:49:50.920021 hook shoebox-test#1 script: scripts/shoebox-test.sh
DBG 2022/10/19 15:49:50.920074 hook shoebox-test#1 parameter: [{"message":_"this_is_a_test"}= authorization=Basic YWFyb246MTIzNA== user_agent=curl/7.79.1 accept=*/* content_length=29 content_type=application/x-www-form-urlencoded]
DBG 2022/10/19 15:49:50.920268 hook shoebox-test#1 output file: /tmp/shoebox_test_1_20221019_1549.txt
INF 2022/10/19 15:49:50.922574 hook shoebox-test#1 done [SUCCESS]
INF 2022/10/19 15:49:50.922684 65.49.31.245 - - [19/Oct/2022:15:49:50 +0000] "POST /shoebox-test HTTP/1.1" 200 186 "" "curl/7.79.1" "REQID=1666194590919863614"
from webhookd.
Hi, this is because your content-type.
Request body (depending the Media Type):
application/x-www-form-urlencoded: keys and values are converted to script variables
text/* or application/json: payload is transmit to the script as first parameter.
If you specify the content type with curl this should work as expected: curl -X POST -H 'Content-Type: application/json' ...
from webhookd.
no problem, thanks!
That worked.
from webhookd.
Related Issues (20)
- Add X-Signature-Ed25519 support HOT 4
- Do we have a variable for the IP address, just like $user_agent? HOT 2
- Returning HTTP status codes HOT 4
- [Feature Request]: basic auth for multiple users HOT 3
- webhookd has no permission for accessing /var/run/docker.sock HOT 2
- The IP address using XFF only works when passing through proxy HOT 1
- Replace "docker-compose" with "docker compose" plugin HOT 1
- Error "openssl: not found" with /scripts/examples/github.sh in official Docker container HOT 1
- Docker logs in local TZ
- Notify the received HTTP request in sum HOT 2
- update ncarlier/webhookd:latest to 1.17.3 HOT 4
- [Feature Request]: ssh support HOT 2
- [Feature Request]: aha support HOT 5
- Auto tracing with OpenTelemetry + tracepusher HOT 1
- [Feature Request] dynamically add packages HOT 2
- Add additional option to manipulate file extension recognition to prevent leaking file extension to uri HOT 3
- Can't send an e-mail through gmail SMTP
- version tags for lightweight docker image HOT 4
- how to retrieve query parameter values HOT 3
- Change responce header: Content-Type HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webhookd.