Skip to content
This repository has been archived by the owner on Aug 20, 2020. It is now read-only.

Ability to optionally assign port for requests when calling client API #8

Merged
merged 1 commit into from
Jul 14, 2017

Conversation

apat183
Copy link
Contributor

@apat183 apat183 commented Jul 14, 2017

When calling client.API, allow for optional port to be assigned in endpointRequest which is then used in the buildrequest.

This is to allow for environments that sit behind corporate firewalls or proxies that have strict environments were HTTPs request must have port 443 assigned during request (unlike the current default request which port is empty).

Usage:

var Client = require('sendgrid-rest').Client
var client = new Client()
var request = client.emptyRequest()
var param = 'myparam'
request.host = 'api.example.com'
request.method = 'GET'

request.port = '443' // optional port is now used in request build rather then being ignored

request.path = '/your/api/' + param + '/call'
client.API(request, function (response) {
  console.log(response.body)
  console.log(response.headers)
})

This would also work the same for the sendgrid-node lib.

…dpointRequest which is then used in the buildrequest.

This is to allow for environments that sit behind corporate firewalls or proxies that have strict environments were HTTPs request must have port 443 assigned during request (unlike the current default request which is empty).
@SendGridDX
Copy link

SendGridDX commented Jul 14, 2017

CLA assistant check
All committers have signed the CLA.

@thinkingserious
Copy link
Contributor

Hi @apat183,

To sign the CLA, you need to have an email on file with GitHub. Could you please update your account and try signing the CLA? Thanks!

@thinkingserious thinkingserious merged commit f1a3fc5 into sendgrid:master Jul 14, 2017
@thinkingserious
Copy link
Contributor

Hello @apat183,

Thanks again for the PR!

We want to show our appreciation by sending you some swag. Could you please fill out this form so we can send it to you? Thanks!

Team SendGrid DX

thinkingserious added a commit that referenced this pull request Jul 14, 2017
@apat183
Copy link
Contributor Author

apat183 commented Jul 14, 2017

Awesome.

Thanks for swag and super quick merge!

Anand.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants