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

httpput-postfields.c: new example doing PUT with POSTFIELDS #6188

Closed
wants to merge 2 commits into from

Conversation

@bagder
Copy link
Member

@bagder bagder commented Nov 9, 2020

Proposed-by: Jeroen Ooms
Ref: #6186

/cc @jeroen

Proposed-by: Jeroen Ooms
Ref: #6186
@jay
Copy link
Member

@jay jay commented Nov 9, 2020

Is this common? I think we'd want to discourage use of customrequest.

@bagder
Copy link
Member Author

@bagder bagder commented Nov 9, 2020

Yes we do. Using the approach shown here won't work if there's a redirect since FOLLOWLOCATION and CUSTOMREQUEST doesn't really go well together...

@jeroen
Copy link
Contributor

@jeroen jeroen commented Nov 9, 2020

@jay Many REST apis require use PUT with a little json/text payload. For example this is what I am working on now, it has many such examples: https://docs.github.com/en/free-pro-team@latest/rest/overview/endpoints-available-for-github-apps

Using PUT to perform a file-upload is actually very rare in practice, I think most users are more interested in the former.

@bagder
Copy link
Member Author

@bagder bagder commented Nov 13, 2020

@jeroen The point isn't really what the PUT is used for, it is rather the inherent problems with using customrequest. Primarily the fact that it often breaks redirect-following. I will add a comment to the example addressing that.

@bagder bagder closed this in 71ec4e7 Nov 13, 2020
@bagder bagder deleted the bagder/httput-postfields branch Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.