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 POST functions #51

Merged
merged 8 commits into from
Sep 22, 2020
Merged

Add POST functions #51

merged 8 commits into from
Sep 22, 2020

Conversation

deepsheth
Copy link
Contributor

Description: This implements POST requests, as suggested in feature request #32.


Technical Details

I introduce two new functions:

  1. Post
  2. PostForm, a convenience function for form submission. Useful when that payload is not JSON formatted and is in the form of a query string.

For Post, the payload is an interface which can be of the following types: map[string]string, netURL.Values (for PostForm requests), []byte, and string.

I also create a new abstraction, the function setHeadersAndCookies which both GET and POST functions and use to build a Request.

Testing

Each function is tested and can be verified by running go test.

@anaskhan96 anaskhan96 self-assigned this Sep 22, 2020
@anaskhan96 anaskhan96 linked an issue Sep 22, 2020 that may be closed by this pull request
@anaskhan96
Copy link
Owner

Hi @deepsheth, thank you for the PR! :)
Apologies for not reviewing this earlier, work can be exhausting :/

@anaskhan96 anaskhan96 merged commit 57e413e into anaskhan96:master Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a Post() function
2 participants