Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON in body is not getting included #102

Closed
ShivamJoker opened this issue Dec 2, 2020 · 10 comments
Closed

JSON in body is not getting included #102

ShivamJoker opened this issue Dec 2, 2020 · 10 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed uptime-monitor Related to the uptime monitor GitHub Action

Comments

@ShivamJoker
Copy link

I am trying this in my yml file as described in the docs, I tried everything but nothing worked it's just sending empty body to the server.
I don't know why, please look into the issue

  - name: User Login Up
    method: POST
    url: https://untitled-21r9rlkgb6mq.runkit.sh
    headers:
      - "Content-Type: application/json; charset=utf-8"
    body: '{ "password": "hello" }'

I also tried quoting the strings but nothing worked in my runkit there is just

// listen for POST requests and respond based on that POSTed data
app.post("/", (req, res) => {

    console.log(req.body);
        
    return res.send({ message: `You posted ${JSON.stringify(req.body)}` });
});

It works properly with CURL but is not with this action
image

Here is what I get in my runkit logs
image

@AnandChowdhary
Copy link
Member

Can you confirm that you are using upptime/uptime-monitor@v1.21.0 in your GitHub Actions workflows?

@AnandChowdhary AnandChowdhary self-assigned this Dec 2, 2020
@AnandChowdhary AnandChowdhary added the question Further information is requested label Dec 2, 2020
AnandChowdhary added a commit to AnandChowdhary/status that referenced this issue Dec 2, 2020
@AnandChowdhary AnandChowdhary added bug Something isn't working uptime-monitor Related to the uptime monitor GitHub Action and removed question Further information is requested labels Dec 2, 2020
@ShivamJoker
Copy link
Author

# This file was generated by upptime/uptime-monitor@v1.22.10

I just used the template a day ago is this internal bug ?

@ShivamJoker
Copy link
Author

Any update on this ?

brettski added a commit to ThatConference/status that referenced this issue Dec 6, 2020
Failing due to what I believe is issue upptime/upptime#102
@AnandChowdhary
Copy link
Member

Not sure why this is not working, I'm setting the POSTFIELDS property on the Curl object. I'm marking this as "up for grabs" in case anyone wants to have a look, and I'll have a second look soon nonetheless. Relevant code: https://github.com/upptime/uptime-monitor/blob/master/src/helpers/request.ts#L16

@AnandChowdhary AnandChowdhary added the help wanted Extra attention is needed label Dec 6, 2020
@ShivamJoker
Copy link
Author

@AnandChowdhary how can I test this locally any contribution or development guides ?

@AnandChowdhary
Copy link
Member

how can I test this locally any contribution or development guides ?

There is a general contributing guideline available here: https://github.com/upptime/.github/blob/main/CONTRIBUTING.md. Apart from that, you can clone the project and open the file I linked above. From there, the easiest thing to do is the invoke the curl() function exported by the file and test it. 😄

@max-acumen
Copy link

Hi Everyone, if you put "data:" in your yml config rather than "body:", it will fix the issue

@AnandChowdhary
Copy link
Member

Thanks to @max-acumen for this fix! I'm so silly. 🙃

@AnandChowdhary
Copy link
Member

Hi Everyone, if you put "data:" in your yml config rather than "body:", it will fix the issue

This is no longer the case, body works now 😄

@ShivamJoker
Copy link
Author

Thanks

namcxn pushed a commit to namcxn/uptime-monitor that referenced this issue Mar 2, 2023
Co-Authored-By: Max Berman <max@acumen.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed uptime-monitor Related to the uptime monitor GitHub Action
Projects
None yet
Development

No branches or pull requests

3 participants