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

add REST API functions and metatable for get #872

Merged
merged 2 commits into from
Feb 20, 2025

Conversation

wd60622
Copy link
Collaborator

@wd60622 wd60622 commented Feb 20, 2025

Convenience wrapper around the REST API

local gh = require "octo.gh"

local opts = { cb = gh.create_callback() }

gh.api { -- or gh.api.get
  "/notifications",
  opts = opts,
}

This would be the same as gh api /notifications with the CLI

Other available methods are:

  • gh.api.post
  • gh.api.patch
  • gh.api.delete

User can still specify the method if gh.api is used, e.g. gh.api { "/notifications", method = "GET" }

Closes #751

@wd60622 wd60622 added the enhancement New feature or request label Feb 20, 2025
@wd60622 wd60622 merged commit cfe829b into pwntester:master Feb 20, 2025
3 checks passed
@wd60622 wd60622 deleted the rest-wrapper branch February 20, 2025 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a wrapper for rest API calls
1 participant