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

[feat] Add Example for Sending HTTP Requests with Ruby Runtime #33

Merged
merged 4 commits into from
Jan 10, 2023

Conversation

sudiptog81
Copy link
Contributor

Sends a HTTP request. All configurations should are received as a payload. Supported options are method, url, body, and headers. Status code, response body, and response headers are returned. No function variables are necessary.

Closes appwrite/appwrite#4178.

Successful Request:

image

Failed Request:

image

Invalid Payload:

image

Copy link
Contributor

@PineappleIOnic PineappleIOnic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey There, Thank you for this PR! However a few issues that could use resolving.

  1. Please resolve the merge conflict by merging main into your branch
  2. Could you return a status code and the body error instead of the entire exception? It makes error handling a lot simpler

@sudiptog81
Copy link
Contributor Author

Hey There, Thank you for this PR! However a few issues that could use resolving.

  1. Please resolve the merge conflict by merging main into your branch
  2. Could you return a status code and the body error instead of the entire exception? It makes error handling a lot simpler

I believe a status code is anyways returned in case of an exception, I have extended the message object in the response to include the one from the actual HTTP response in the latest commit.

@sudiptog81
Copy link
Contributor Author

image

@Meldiron
Copy link
Contributor

Thank you so much for the PR 🤩. We're adding the hacktoberfest-accepted label to ensure this PR counts towards your Hacktoberfest contributions count. With that said, please stay active on this PR to address any comments once you receive a review. Happy Hacktoberfest! 🎃

Copy link
Member

@adityaoberai adityaoberai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the function and got a valid response.

LGTM 👍

Copy link
Contributor

@PineappleIOnic PineappleIOnic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, gets my 🦭

@christyjacob4
Copy link
Contributor

@sudiptog81 please resolve the conflicts

@sudiptog81
Copy link
Contributor Author

@sudiptog81 please resolve the conflicts

Resolved!

@christyjacob4 christyjacob4 merged commit 9cbf52a into open-runtimes:main Jan 10, 2023
@christyjacob4
Copy link
Contributor

THANK YOU! All changes merged 🥳

Please reach out to me on our Discord server if you would like to claim your Appwrite swags! As a way of saying thank you, we would also love to invite you to join the Appwrite organization on GitHub. Please share your GitHub username with us on Discord.  

You can accept the invite by visiting https://github.com/orgs/appwrite/invitation. By joining our team, you will officially be an Appwrite maintainer on GitHub.

You can change your membership visibility settings, so your new Appwrite team membership badge will show up on your personal GitHub profile.

Please feel free to look for more PRs you might be interested in helping with on our long list of Hacktoberfest friendly issues and help make Appwrite better :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

⚡ Write a sendHTTPRequest() Function using Ruby
5 participants