Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] chore: migrate http client from request to got #1050

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
language: node_js
node_js:
- 6
- 7
- 8
- 10
- lts/*
- node
Expand Down
2 changes: 1 addition & 1 deletion packages/client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ To be notified when this package is updated, please subscribe to email [notifica

## Prerequisites

- Node.js version 6, 7 or 8
- Node.js version 10, 12, or 13
- A Twilio SendGrid account, [sign up for free](https://sendgrid.com/free?source=sendgrid-nodejs) to send up to 40,000 emails for the first 30 days or check out [our pricing](https://sendgrid.com/pricing?source=sendgrid-nodejs).

## Obtain an API Key
Expand Down
6 changes: 3 additions & 3 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
"node": ">=6.0.0"
},
"dependencies": {
"@sendgrid/helpers": "^6.5.3",
"@types/request": "^2.48.4",
"request": "^2.88.0"
"@types/got": "^9.6.9",
"got": "^10.6.0",
"@sendgrid/helpers": "^6.5.3"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sort plez (@'s first)

},
"tags": [
"http",
Expand Down
6 changes: 3 additions & 3 deletions packages/client/src/classes/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Dependencies
*/
const http = require('request');
const http = require('got');
const pkg = require('../../package.json');
const {
helpers: {
Expand Down Expand Up @@ -35,8 +35,8 @@ class Client {

//Empty default request
this.defaultRequest = {
json: true,
baseUrl: 'https://api.sendgrid.com/',
json: {},
prefixUrl: 'https://api.sendgrid.com/',
url: '',
method: 'GET',
headers: {},
Expand Down
2 changes: 1 addition & 1 deletion packages/mail/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ To be notified when this package is updated, please subscribe to email [notifica

## Prerequisites

- Node.js version 6, 7 or 8
- Node.js version 10, 12, or 13
- A Twilio SendGrid account, [sign up for free](https://sendgrid.com/free?source=sendgrid-nodejs) to send up to 40,000 emails for the first 30 days or check out [our pricing](https://sendgrid.com/pricing?source=sendgrid-nodejs).

## Obtain an API Key
Expand Down
2 changes: 1 addition & 1 deletion packages/mail/src/classes/mail-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class MailService {
const request = {
method: 'POST',
url: '/v3/mail/send',
body,
json: body,
};

//Send
Expand Down