-
Notifications
You must be signed in to change notification settings - Fork 28
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
Show response body for failed request #115
Comments
Might be useful just to store response for any result. |
I'm running into issues where I can't figure out why my webhook isn't working, and it would be helpful to see both the request and the response in even the debug logs on the server. This would go a long way in figuring out why I'm getting a particular code. |
Of course! If you're happy with debug logging as an interim solution, I'll try to add that and get rc2 out in the next day or so. |
Hi @kymikoloco and @YoungjaeKim However, here is a build which has the added DEBUG logging. You can login as a guest on that teamcity instance to download the zip files. Please let me know how you get on.
I will also look at adding the logging of all the response headers. This are currently not shown in the log. To enable debug logging in teamcity, see this page. |
@netwolfuk Just installed the build, and the server logs are printing the response headers, so it works for me. Though now, the server response says that an argument 'type' is missing when it is being sent. Should I make a new issue for this?
|
Hi @kymikoloco I'm not sure what format the server is expecting, but it looks like it wants a variable called |
I'm attempting to use this API: https://zulipchat.com/api/private-message and I created my own template. The '@type' I took from the Microsoft Teams template, thinking the type was getting lost somewhere, or was getting mistaken for Content-Type and being consumed somehow, but with or without the curl works with x-www-form-urlencoded, but attempting to use application/json, it fails the same way as tcWebHooks, with a BadRequest (400). It seems like the API endpoint I'm using is not robust enough to accept JSON for API requests. |
Ok, that's good debugging. Well done. It should be possible to create a new template type to support |
BTW, if I remember correctly So something like this might work in your template (as long as you provide a As per https://zulipchat.com/api/send-message
|
Or you could create a legacy nvpairs webhook and create build parameters called The webhook will also post a ton of other cruft, but as long as the end point is only looking for those items, it might work. BTW, from version 2.0, the legacy webhook formats will only send the requested fields, not everything by default. |
Using the legacy nvpairs with the build parameters works! I'll probably revisit it later as it's not the most user friendly way to send a message, but I'm glad it works, thanks! |
You could also move the build parameters to the project level, and they will be inherited by the builds. But, yeah. Can you add a new issue to add a |
Expected Behavior
In order to investigate failed webhook easily, it would be good to show
response.content
if possible.Current Behavior
Currently, only status code is displayed. As you know,
Bad Request
usually contains error message in content.Steps to Reproduce (for bugs)
N/A
Your Environment
Example Configuration (xml)
I can provide it if you needed to.
The text was updated successfully, but these errors were encountered: