An open API service indexing awesome lists of open source software.

https://github.com/shafiqaimanx/slash

Simple HTTP library for Golang, heavily inspired by: https://github.com/gocolly/colly
https://github.com/shafiqaimanx/slash

go golang http

Last synced: about 1 year ago
JSON representation

Simple HTTP library for Golang, heavily inspired by: https://github.com/gocolly/colly

Awesome Lists containing this project

README

          

# Slash://

## Example

```go
package main

import (
"fmt"

"github.com/shafiqaimanx/slash/pkg/slash"
)

func main() {
// Init the SlashClient
sc := slash.NewSlashClient()

// OnResponse will print the response body
sc.OnResponse(func(r *slash.Response) {
fmt.Printf("Response Body:\n %s\n", r.Body)
})

// OnError handling errors
sc.OnError(func(r *slash.Response, err error) {
if err != nil {
fmt.Printf("Error: %v\n", err)
}
})

// Visiting the URL
sc.Visit("https://example.com")
}
```