node-request

HTTP Auth request fails in browser due to CORS, ok in Node

喜欢而已 提交于 2021-02-09 10:39:00
问题 I'm stuck trying to diagnose a problem where a GET request with HTTP Basic Auth succeeds in Node, but fails in the browser. The problem manifests directly as a CORS failure (there's no Access-Control-Allow-Origin on the 401 page). request.js:119 OPTIONS http://HOST?PARAMS 401 (Unauthorized) ClientRequest._onFinish @ request.js:119 (anonymous) @ request.js:61 ... 17:53:59.170 localhost/:1 Failed to load http://HOST?PARAMS: Response to preflight request doesn't pass access control check: No

HTTP Auth request fails in browser due to CORS, ok in Node

荒凉一梦 提交于 2021-02-09 10:33:52
问题 I'm stuck trying to diagnose a problem where a GET request with HTTP Basic Auth succeeds in Node, but fails in the browser. The problem manifests directly as a CORS failure (there's no Access-Control-Allow-Origin on the 401 page). request.js:119 OPTIONS http://HOST?PARAMS 401 (Unauthorized) ClientRequest._onFinish @ request.js:119 (anonymous) @ request.js:61 ... 17:53:59.170 localhost/:1 Failed to load http://HOST?PARAMS: Response to preflight request doesn't pass access control check: No

Receiving “Uploading file too fast!” error from Imgur API

本秂侑毒 提交于 2021-01-28 15:34:48
问题 I created a node.js server that uses busboy to take requests, and pipe the files to Imgur for upload. However, I keep getting an "Uploading file too fast!" response from Imgur, and I'm not sure exactly what the problem is. Here is the code snippet involving busboy: var express = require('express'); var Busboy = require('busboy'); var fs = require('fs'); var request = require('request-promise'); var router = express.Router(); router.post('/u', function(req, res, next) { var busboy = new Busboy

Receiving “Uploading file too fast!” error from Imgur API

只愿长相守 提交于 2021-01-28 15:33:09
问题 I created a node.js server that uses busboy to take requests, and pipe the files to Imgur for upload. However, I keep getting an "Uploading file too fast!" response from Imgur, and I'm not sure exactly what the problem is. Here is the code snippet involving busboy: var express = require('express'); var Busboy = require('busboy'); var fs = require('fs'); var request = require('request-promise'); var router = express.Router(); router.post('/u', function(req, res, next) { var busboy = new Busboy

Receiving “Uploading file too fast!” error from Imgur API

两盒软妹~` 提交于 2021-01-28 15:33:01
问题 I created a node.js server that uses busboy to take requests, and pipe the files to Imgur for upload. However, I keep getting an "Uploading file too fast!" response from Imgur, and I'm not sure exactly what the problem is. Here is the code snippet involving busboy: var express = require('express'); var Busboy = require('busboy'); var fs = require('fs'); var request = require('request-promise'); var router = express.Router(); router.post('/u', function(req, res, next) { var busboy = new Busboy

How to insert binary data into sql server using node-mssql

雨燕双飞 提交于 2021-01-28 04:08:37
问题 I'm downloading an image using node/request module, and I'm trying to figure out how to insert that image into a varbinary field in sql server using the node/mssql module. So far I have tried putting a cast into the insert statement, converting the body (buffer) to a string, all to no avail. I'm trying to figure out how to do this without using a stored procedure. Thanks! 回答1: I've read in a .png image file from disk as 'binary', and then put that into a 'binary' buffer, and then was able to

Web App call fails with “… Error code INTERNAL” with Custom API

本小妞迷上赌 提交于 2021-01-01 07:45:27
问题 I have a spreadsheet with a collection of cards, and I wrote a doGet() function to pick a random one, and return it to the user. When entering the Web App url into a web browser, the result appears fine. However, when I try to make a HTTP Get request through the request module, it returns this: <!DOCTYPE html><html><head><link rel="shortcut icon" href="//ssl.gstatic.com/docs/script/images/favicon.ico"><title>Error</title><style type="text/css">body {background-color: #fff; margin: 0; padding:

Web App call fails with “… Error code INTERNAL” with Custom API

时光怂恿深爱的人放手 提交于 2021-01-01 07:42:12
问题 I have a spreadsheet with a collection of cards, and I wrote a doGet() function to pick a random one, and return it to the user. When entering the Web App url into a web browser, the result appears fine. However, when I try to make a HTTP Get request through the request module, it returns this: <!DOCTYPE html><html><head><link rel="shortcut icon" href="//ssl.gstatic.com/docs/script/images/favicon.ico"><title>Error</title><style type="text/css">body {background-color: #fff; margin: 0; padding: