-
Notifications
You must be signed in to change notification settings - Fork 9
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
Gotenberg 7, WebHooks Headers and 204 response #47
Comments
Hello! Glad you find it useful :) I wonder, what if I change condition for successful response to Unfortunately there is no workaround to adjust request like with header, but you have another option. This is undocumented, but library allows you to use completely your own HTTP client instead of included. You can pass it as a second argument in function HTTP client it is an object with methods gotenberg-js-client/src/_types.ts Lines 11 to 20 in 4167947
As a second argument you can pass either client object, or function factory, or class. If you pass function factory or class, you also can add optional third argument with any configuration for your client. gotenberg('<url>', client)
gotenberg('<url>', clientFactory, config)
gotenberg('<url>', ClientClass, config) For example, you can use import got from 'got'
const client = {
post: (url, body, headers) =>
Promise.resolve(
got.post({ url, body, headers, isStream: true })),
}
pipe(
gotenberg(`http://localhost:3500/forms/chromium`, client),
// ... |
I decided it shouldn't break anything, and published small change in version 0.7.3, you can try it :) |
Hi @yumauri, Apologies for not getting back earlier. I just updated to 0.7.3 and removed my try catch for the 204 and it worked fine. Thanks for make the change. Regards, |
Hi,
Firstly, thanks so much for your client library.
We are attempting to use your library to make calls to Gotenberg 7.53. I have read the comments about making the necessary adjustments for version 7 and so far everything seems to work fine when Gotenberg returns a 200 response.
However, we would really like to use the WebHooks feature and we have the following issues -
Gotenberg-Webhookurl-${name} instead of Gotenberg-Webhook-Url-${name}
We are currently working around this issue by setting the headers by hand in a custom function within the pipe method.
Gottenberg Docs
In your node.ts file it seems that the client is configured to reject all responses other than 200.
Do you know of anyway to override or workaround this issue this? Currently I am just catching the error and looking for the words '204 No Content'.
Regards,
Tarek
The text was updated successfully, but these errors were encountered: