Skip to content

Feature: client endpoint#66

Merged
icyleaf merged 4 commits intomasterfrom
features/client-endpoint
May 20, 2019
Merged

Feature: client endpoint#66
icyleaf merged 4 commits intomasterfrom
features/client-endpoint

Conversation

@icyleaf
Copy link
Copy Markdown
Owner

@icyleaf icyleaf commented May 20, 2019

Usages:

Quick shot

Halite.endpoint("https://httpbin.org").get("/get")

Use endpoint as configuration

client  = Halite::Client.new(endpoint: "https://httpbin.org")
# Or
client  = Halite::Client.new do
  endpoint "https://httpbin.org"
end

client.get("/get")

Overwrite the path of endpoint

client  = Halite::Client.new do
  endpoint "https://example.com/api"
end

client.get("users")      # GET https://example.com/api/users
client.get("/users")     # GET https://example.com/users

/relates #64

@icyleaf icyleaf merged commit 377d80a into master May 20, 2019
@icyleaf icyleaf deleted the features/client-endpoint branch May 20, 2019 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant