Skip to content
/ sqlreq Public

SQLReq is a wrapper around standard Go net/http client. You can execute REST requests using SQL-like syntax.

License

Notifications You must be signed in to change notification settings

scootpl/sqlreq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQLReq

Go Reference Go Report Card

SQLReq is a wrapper around standard Go net/http client. You can execute REST requests using SQL-like syntax.

Quick Start

import "github.com/scootpl/sqlreq"

xauth, status, err := sqlreq.SelectHEADER(`
    X-AUTH FROM http://example.com/api/init
    WHERE login = testlogin AND pass = testpass
    WITH POST`)
token := "12345678"

payload := Msg{
    Message: "test",
}

body, status, err := sqlreq.SelectBODY(`
    FROM http://example.com/api/status
    WHERE HEADER x-auth = %s AND
    PAYLOAD = ?
    WITH POST`, token, &payload)
resp, status, err := sqlreq.SelectRESPONSE(`
    FROM http://example.com/api/status
    WHERE HEADER x-auth = '123456' AND
    message = 'test'
    WITH TIMEOUT 30
    WITH POST`)

See GoDoc for more details.

About

SQLReq is a wrapper around standard Go net/http client. You can execute REST requests using SQL-like syntax.

Topics

Resources

License

Stars

Watchers

Forks

Languages