mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-16 04:12:16 +01:00
updating documentation with Golang examples for custom HTTP headers
This commit is contained in:
@@ -81,7 +81,17 @@ $ curl --request POST \
|
||||
|
||||
### Go
|
||||
|
||||
// TODO
|
||||
```golang
|
||||
import "github.com/thecodingmachine/gotenberg-go-client/v6"
|
||||
|
||||
func main() {
|
||||
c := &gotenberg.Client{Hostname: "http://localhost:3000"}
|
||||
req := gotenberg.NewURLRequest("https://google.com")
|
||||
req.AddRemoteURLHTTPHeader("Your-Header", "Foo")
|
||||
dest := "result.pdf"
|
||||
c.Store(req, dest)
|
||||
}
|
||||
```
|
||||
|
||||
### PHP
|
||||
|
||||
|
||||
@@ -124,7 +124,17 @@ $ curl --request POST \
|
||||
|
||||
### Go
|
||||
|
||||
// TODO
|
||||
```golang
|
||||
import "github.com/thecodingmachine/gotenberg-go-client/v6"
|
||||
|
||||
func main() {
|
||||
c := &gotenberg.Client{Hostname: "http://localhost:3000"}
|
||||
req, _ := gotenberg.NewHTMLRequest("index.html")
|
||||
req.WebhookURL("http://myapp.com/webhook/")
|
||||
req.AddWebhookURLHTTPHeader("Your-Header", "Foo")
|
||||
resp, _ := c.Post(req)
|
||||
}
|
||||
```
|
||||
|
||||
### PHP
|
||||
|
||||
|
||||
Reference in New Issue
Block a user