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

GitHubAPI fails when the API responds with a 204 No Content #894

Closed
gcotelli opened this issue Jun 26, 2018 · 1 comment
Closed

GitHubAPI fails when the API responds with a 204 No Content #894

gcotelli opened this issue Jun 26, 2018 · 1 comment
Milestone

Comments

@gcotelli
Copy link
Contributor

I'm using the API to remove labels in my projects, and it fails because delete: expects a JSON content as response, and it's not always the case. For labels, for example, the API will return a 204 No Content when it's successful.

@gcotelli
Copy link
Contributor Author

You can try it in a new testing repo using:

| repo owner api labels |
repo := 'REPO'.
owner := 'OWNER'.
api := IceGitHubAPI new 
	credentials: (IcePlaintextCredentials new username: 'USER';password: 'PASSWORD';yourself).
labels := api get: ('repos/<1s>/<2s>/labels' expandMacrosWith: owner with: repo).
labels collect: [ :label | api delete: ('/repos/<1s>/<2s>/labels/<3s>' expandMacrosWith: owner with: repo with: (label at: #name) urlEncoded)  ].

@guillep guillep added this to the 1.2 milestone Jun 26, 2018
@guillep guillep closed this as completed Jun 26, 2018
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

No branches or pull requests

2 participants