Giter Club home page Giter Club logo

Comments (5)

ncarlier avatar ncarlier commented on July 17, 2024 1

BTW, you are right, the README is not correct and should specify the content type as well. Thanks for pointing this out.

from webhookd.

free-soellingeraj avatar free-soellingeraj commented on July 17, 2024

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.

free-soellingeraj avatar free-soellingeraj commented on July 17, 2024

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.

ncarlier avatar ncarlier commented on July 17, 2024

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.

free-soellingeraj avatar free-soellingeraj commented on July 17, 2024

no problem, thanks!
That worked.

from webhookd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.