Skip to content

Allow custom api url#21

Closed
scobal wants to merge 1 commit intosendgrid:masterfrom
scobal:master
Closed

Allow custom api url#21
scobal wants to merge 1 commit intosendgrid:masterfrom
scobal:master

Conversation

@scobal
Copy link
Copy Markdown

@scobal scobal commented Mar 26, 2014

Hello :)

This PR lets the API url be changed during construction. This enables the use of test libraries that capture HTTP requests (specifically I'm using https://github.com/rest-driver/rest-driver/wiki/Client-driver).

@pires
Copy link
Copy Markdown

pires commented May 6, 2014

+1

@motdotla
Copy link
Copy Markdown
Contributor

motdotla commented May 6, 2014

This is nice. Can you add a test for this @scobal. I will try to get to it soon though to add it myself.

@scobal
Copy link
Copy Markdown
Author

scobal commented May 7, 2014

Thanks Scott. Did you have a specific test in mind? The three that spring to mind for me are:

  1. Making sure the api url that's passed in is used.
  2. If no api url is passed then make sure the default is used.
  3. Making sure the default url is correct

@motdotla
Copy link
Copy Markdown
Contributor

This made it in, but in a slightly different way. Thanks for this!

https://github.com/sendgrid/sendgrid-java/blob/master/src/main/java/com/sendgrid/SendGrid.java#L34

setUrl and setEndpoint are what you want now

@motdotla motdotla closed this Jun 13, 2014
@scobal
Copy link
Copy Markdown
Author

scobal commented Jun 13, 2014

Cool, thanks @scottmotte

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.

3 participants