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
- Host: GitHub
- URL: https://github.com/shafiqaimanx/slash
- Owner: shafiqaimanx
- Created: 2025-01-05T22:02:35.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-13T20:04:15.000Z (about 1 year ago)
- Last Synced: 2025-01-13T20:39:38.448Z (about 1 year ago)
- Topics: go, golang, http
- Language: Go
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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")
}
```