iriscouch / browser-request Goto Github PK
View Code? Open in Web Editor NEWBrowser library compatible with Node.js request package
License: Apache License 2.0
Browser library compatible with Node.js request package
License: Apache License 2.0
I'm using it like:
var request = require('browser-request');
request('/blah', (err, resp, body) => {
});
But in the browser console, I get the uncaught exception "Error: no options given". However, according to the documentation, I don't need to give any options for a fetch request??
import google.generativeai as genai
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/tiger/miniconda3/envs/gemini/lib/python3.9/site-packages/google/generativeai/__init__.py", line 45, in <module>
from google.generativeai import types
File "/home/tiger/miniconda3/envs/gemini/lib/python3.9/site-packages/google/generativeai/types/__init__.py", line 17, in <module>
from google.generativeai.types.citation_types import *
File "/home/tiger/miniconda3/envs/gemini/lib/python3.9/site-packages/google/generativeai/types/citation_types.py", line 20, in <module>
from google.ai import generativelanguage as glm
File "/home/tiger/miniconda3/envs/gemini/lib/python3.9/site-packages/google/ai/generativelanguage/__init__.py", line 21, in <module>
from google.ai.generativelanguage_v1beta.services.discuss_service.async_client import (
File "/home/tiger/miniconda3/envs/gemini/lib/python3.9/site-packages/google/ai/generativelanguage_v1beta/__init__.py", line 21, in <module>
from .services.discuss_service import DiscussServiceAsyncClient, DiscussServiceClient
File "/home/tiger/miniconda3/envs/gemini/lib/python3.9/site-packages/google/ai/generativelanguage_v1beta/services/discuss_service/__init__.py", line 16, in <module>
from .async_client import DiscussServiceAsyncClient
File "/home/tiger/miniconda3/envs/gemini/lib/python3.9/site-packages/google/ai/generativelanguage_v1beta/services/discuss_service/async_client.py", line 48, in <module>
from google.ai.generativelanguage_v1beta.types import discuss_service, safety
File "/home/tiger/miniconda3/envs/gemini/lib/python3.9/site-packages/google/ai/generativelanguage_v1beta/types/__init__.py", line 16, in <module>
from .citation import CitationMetadata, CitationSource
File "/home/tiger/miniconda3/envs/gemini/lib/python3.9/site-packages/google/ai/generativelanguage_v1beta/types/citation.py", line 22, in <module>
__protobuf__ = proto.module(
AttributeError: module 'proto' has no attribute 'module'
No response
I could make this work on Mac and another instance. But can not make it work on our development environment. I am not sure if this is about the package version issues?
There are more environment info:
aiofiles==22.1.0
aiosqlite==0.20.0
annotated-types==0.7.0
anyio==4.3.0
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
arrow==1.3.0
asttokens==2.4.1
attrs==23.1.0
Babel==2.15.0
beautifulsoup4==4.12.3
bidict==0.23.1
bleach==6.1.0
byted-remote-ikernel==0.4.8
byted-torch-monitor @ https://d.scm.byted.org/api/v2/download/lab.pytorch.torch_monitor_1.0.0.6.tar.gz#sha256=333bc7b5f093bb449cad019a5351702f7497fc7b5e4a3f1c82f6567e607c3e1e
byted-wandb==0.13.72
bytedance-context==0.7.1
bytedance-metrics==0.5.1
bytedance.modelhub==0.0.64
bytedance.servicediscovery==0.1.2
bytedbackgrounds==0.0.6
byteddatabus==1.0.6
byteddps==0.1.2
bytedenv==0.6.2
bytedlogger==0.15.1
bytedmemfd==0.2
bytedmetrics==0.10.2
bytedpymongo==2.0.5
bytedrh2==1.18.7a2
bytedservicediscovery==0.17.4
bytedtcc==1.4.2
bytedtos==1.1.16
bytedtrace==0.3.0
bytedztijwthelper==0.0.22
bytedztispiffe==0.0.14
cachetools==5.3.3
certifi==2024.2.2
cffi==1.16.0
chardet==5.2.0
charset-normalizer==3.3.2
click==8.1.7
comm==0.2.2
crcmod==1.7
cryptography==42.0.7
debugpy==1.8.1
decorator==5.1.1
defusedxml==0.7.1
Deprecated==1.2.14
distlib==0.3.8
dnspython==2.6.1
docker-pycreds==0.4.0
entrypoints==0.4
exceptiongroup==1.2.1
executing==2.0.1
fastjsonschema==2.19.1
filelock==3.14.0
fqdn==1.5.1
gitdb==4.0.11
GitPython==3.1.43
google-ai-generativelanguage==0.6.3
google-api-core==2.19.0
google-api-python-client==2.129.0
google-auth==2.29.0
google-auth-httplib2==0.2.0
google-generativeai==0.5.3
googleapis-common-protos==1.63.0
grpcio==1.64.0
grpcio-status==1.62.2
h11==0.14.0
httplib2==0.22.0
idna==3.7
importlib_metadata==7.1.0
iniconfig==2.0.0
ipaddress==1.0.23
ipykernel==6.29.4
ipython==8.18.1
ipython-genutils==0.2.0
ipywidgets==8.1.2
isoduration==20.11.0
jedi==0.19.1
json5==0.9.25
jsonpointer==2.4
jsonschema==4.22.0
jsonschema-specifications==2023.12.1
jupyter==1.0.0
jupyter-client==7.0.0
jupyter-console==6.6.3
jupyter-events==0.10.0
jupyter-ydoc==0.2.5
jupyter_core==5.7.2
jupyter_server==2.14.0
jupyter_server_fileid==0.9.2
jupyter_server_terminals==0.5.3
jupyter_server_ydoc==0.8.0
jupyterlab==3.6.4
jupyterlab_pygments==0.3.0
jupyterlab_server==2.27.1
jupyterlab_widgets==3.0.10
lmms_eval==0.1.1
matplotlib-inline==0.1.7
mistune==3.0.2
msgpack==1.0.8
nbclassic==1.0.0
nbclient==0.10.0
nbconvert==7.16.4
nbformat==5.10.4
nest-asyncio==1.6.0
notebook==6.5.7
notebook_shim==0.2.4
overrides==7.7.0
packaging==24.0
pandocfilters==1.5.1
parso==0.8.4
pathlib2==2.3.7.post1
pathtools==0.1.2
pexpect==4.8.0
platformdirs==4.2.2
pluggy==1.5.0
ply==3.11
prometheus_client==0.20.0
promise==2.3
prompt-toolkit==3.0.43
proto-plus==1.23.0
protobuf==4.24.3
psutil==5.9.8
ptyprocess==0.7.0
pure-eval==0.2.2
py==1.11.0
py-spy==0.3.14
pyarrow==16.1.0
pyasn1==0.6.0
pyasn1_modules==0.4.0
pycparser==2.22
pycryptodomex==3.20.0
pydantic==2.7.1
pydantic_core==2.18.2
Pygments==2.18.0
PyJWT==2.8.0
pyOpenSSL==24.1.0
pyparsing==3.1.2
pytest==6.2.5
python-consul==1.1.0
python-dateutil==2.9.0.post0
python-engineio==4.9.1
python-etcd==0.4.5
python-json-logger==2.0.7
python-socketio==5.11.2
PyYAML==6.0.1
pyzmq==26.0.3
qtconsole==5.5.2
QtPy==2.4.1
referencing==0.35.1
requests==2.32.2
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rpds-py==0.18.1
rsa==4.9
schedule==1.2.1
Send2Trash==1.8.3
sentry-sdk==2.3.0
setproctitle==1.3.3
shortuuid==1.0.13
simple-websocket==1.0.0
smmap==5.0.1
sniffio==1.3.1
soupsieve==2.5
stack-data==0.6.3
terminado==0.18.1
thriftpy2==0.5.0
tinycss2==1.3.0
toml==0.10.2
tomli==2.0.1
tornado==6.4
tox==3.28.0
tqdm==4.66.4
traitlets==5.14.3
types-python-dateutil==2.9.0.20240316
typing_extensions==4.11.0
uri-template==1.3.0
uritemplate==4.1.1
urllib3==2.2.1
virtualenv==20.26.2
wandb==0.17.0
watchdog==4.0.0
wcwidth==0.2.13
webcolors==1.13
webencodings==0.5.1
websocket-client==1.8.0
widgetsnbextension==4.0.10
wrapt==1.16.0
wsproto==1.2.0
y-py==0.6.2
ypy-websocket==0.8.4
zipp==3.18.2
Originally posted by @Luodian in google-gemini/generative-ai-python#360
browser-request is broken in FF, due to the following code:
for (key in window) // XMLHttpRequest is not enumerated in FF
if(window.hasOwnProperty(key))
win[key] = window[key]
run_code()
for (key in window)
if(window.hasOwnProperty(key))
if(window[key] !== win[key]) {
exports[key] = window[key] // ... therefore it's never exported here
window[key] = win[key]
}
// therefore the exports object is empty and this throws
var xmlhttprequest = require('./xmlhttprequest')
if(!xmlhttprequest || typeof xmlhttprequest !== 'object')
throw new Error('Could not find ./xmlhttprequest')
This currently breaks voxel-gist in FF (cc @maxogden).
I'd like to submit a PR, but can't figure out how to run tests. rake test
fails because it's trying to hit http://localhost:5984/test-browser-request
, which I have no idea how to create.
Also, before attempting a fix, I wanted to ask why the for ... in
loop was being used at all, because I believe XMLHttpRequest (the library, not the built-in) only exports XMLHttpRequest, meaning the exports are known. Unless there are others that I don't know about?
Hi there, how hard would it be to support proxy
option, that is supported in the node request
?
I was thinking, we would just need to replace the host address in URL of each request with the proxy host/ip address and it should work, am I wrong?
Use case: We're trying to switch from request
to browser-request
because of HTTP/2 support. We use this in Electron, so we have both node
and browser
environments.
Needs a good way to test.
In request_jquery, there was options.creds
or options.withCredentials
which would set "xhrFields": { "withCredentials": true }
to the jQuery.ajax call.
The latest request has an option 'encoding' which allows getting files as buffers or at least, bypassing the conversion to unicode. This option is not present in browser-request not does it warn the user about it.
Need to check if real request does this. I doubt it does.
The philosophical question becomes, duplicate the request API, or emulate the request API. In other words, cache-busting is probably going to be necessary to make it feel like Node.
is this possible at the moment?
It seems to me, that requests made with browser-requests never follow redirects, but rather return the 30x response.
I just found the source for the error, that it's not supported:
Line 57 in d99a386
Could you please document / mention the reason why it's not supported?
(And for those wanting redirect support I suppose we have to handle the 30x response ourselves, right?)
In the original request lib, to use basic authentication you set auth.user
and auth.pass
in options
request.get('http://some.server.com/', {
'auth': {
'user': 'username',
'pass': 'password',
'sendImmediately': false
}
});
Ref: https://www.npmjs.com/package/request#http-authentication
But browser-request expectsauth.username
and auth.password
. See
Line 160 in 5966b45
This breaks compatibility between the two libs.
import google.generativeai as genai
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/tiger/miniconda3/envs/gemini/lib/python3.9/site-packages/google/generativeai/__init__.py", line 45, in <module>
from google.generativeai import types
File "/home/tiger/miniconda3/envs/gemini/lib/python3.9/site-packages/google/generativeai/types/__init__.py", line 17, in <module>
from google.generativeai.types.citation_types import *
File "/home/tiger/miniconda3/envs/gemini/lib/python3.9/site-packages/google/generativeai/types/citation_types.py", line 20, in <module>
from google.ai import generativelanguage as glm
File "/home/tiger/miniconda3/envs/gemini/lib/python3.9/site-packages/google/ai/generativelanguage/__init__.py", line 21, in <module>
from google.ai.generativelanguage_v1beta.services.discuss_service.async_client import (
File "/home/tiger/miniconda3/envs/gemini/lib/python3.9/site-packages/google/ai/generativelanguage_v1beta/__init__.py", line 21, in <module>
from .services.discuss_service import DiscussServiceAsyncClient, DiscussServiceClient
File "/home/tiger/miniconda3/envs/gemini/lib/python3.9/site-packages/google/ai/generativelanguage_v1beta/services/discuss_service/__init__.py", line 16, in <module>
from .async_client import DiscussServiceAsyncClient
File "/home/tiger/miniconda3/envs/gemini/lib/python3.9/site-packages/google/ai/generativelanguage_v1beta/services/discuss_service/async_client.py", line 48, in <module>
from google.ai.generativelanguage_v1beta.types import discuss_service, safety
File "/home/tiger/miniconda3/envs/gemini/lib/python3.9/site-packages/google/ai/generativelanguage_v1beta/types/__init__.py", line 16, in <module>
from .citation import CitationMetadata, CitationSource
File "/home/tiger/miniconda3/envs/gemini/lib/python3.9/site-packages/google/ai/generativelanguage_v1beta/types/citation.py", line 22, in <module>
__protobuf__ = proto.module(
AttributeError: module 'proto' has no attribute 'module'
No response
I could make this work on Mac and another instance. But can not make it work on our development environment. I am not sure if this is about the package version issues?
There are more environment info:
aiofiles==22.1.0
aiosqlite==0.20.0
annotated-types==0.7.0
anyio==4.3.0
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
arrow==1.3.0
asttokens==2.4.1
attrs==23.1.0
Babel==2.15.0
beautifulsoup4==4.12.3
bidict==0.23.1
bleach==6.1.0
byted-remote-ikernel==0.4.8
byted-torch-monitor @ https://d.scm.byted.org/api/v2/download/lab.pytorch.torch_monitor_1.0.0.6.tar.gz#sha256=333bc7b5f093bb449cad019a5351702f7497fc7b5e4a3f1c82f6567e607c3e1e
byted-wandb==0.13.72
bytedance-context==0.7.1
bytedance-metrics==0.5.1
bytedance.modelhub==0.0.64
bytedance.servicediscovery==0.1.2
bytedbackgrounds==0.0.6
byteddatabus==1.0.6
byteddps==0.1.2
bytedenv==0.6.2
bytedlogger==0.15.1
bytedmemfd==0.2
bytedmetrics==0.10.2
bytedpymongo==2.0.5
bytedrh2==1.18.7a2
bytedservicediscovery==0.17.4
bytedtcc==1.4.2
bytedtos==1.1.16
bytedtrace==0.3.0
bytedztijwthelper==0.0.22
bytedztispiffe==0.0.14
cachetools==5.3.3
certifi==2024.2.2
cffi==1.16.0
chardet==5.2.0
charset-normalizer==3.3.2
click==8.1.7
comm==0.2.2
crcmod==1.7
cryptography==42.0.7
debugpy==1.8.1
decorator==5.1.1
defusedxml==0.7.1
Deprecated==1.2.14
distlib==0.3.8
dnspython==2.6.1
docker-pycreds==0.4.0
entrypoints==0.4
exceptiongroup==1.2.1
executing==2.0.1
fastjsonschema==2.19.1
filelock==3.14.0
fqdn==1.5.1
gitdb==4.0.11
GitPython==3.1.43
google-ai-generativelanguage==0.6.3
google-api-core==2.19.0
google-api-python-client==2.129.0
google-auth==2.29.0
google-auth-httplib2==0.2.0
google-generativeai==0.5.3
googleapis-common-protos==1.63.0
grpcio==1.64.0
grpcio-status==1.62.2
h11==0.14.0
httplib2==0.22.0
idna==3.7
importlib_metadata==7.1.0
iniconfig==2.0.0
ipaddress==1.0.23
ipykernel==6.29.4
ipython==8.18.1
ipython-genutils==0.2.0
ipywidgets==8.1.2
isoduration==20.11.0
jedi==0.19.1
json5==0.9.25
jsonpointer==2.4
jsonschema==4.22.0
jsonschema-specifications==2023.12.1
jupyter==1.0.0
jupyter-client==7.0.0
jupyter-console==6.6.3
jupyter-events==0.10.0
jupyter-ydoc==0.2.5
jupyter_core==5.7.2
jupyter_server==2.14.0
jupyter_server_fileid==0.9.2
jupyter_server_terminals==0.5.3
jupyter_server_ydoc==0.8.0
jupyterlab==3.6.4
jupyterlab_pygments==0.3.0
jupyterlab_server==2.27.1
jupyterlab_widgets==3.0.10
lmms_eval==0.1.1
matplotlib-inline==0.1.7
mistune==3.0.2
msgpack==1.0.8
nbclassic==1.0.0
nbclient==0.10.0
nbconvert==7.16.4
nbformat==5.10.4
nest-asyncio==1.6.0
notebook==6.5.7
notebook_shim==0.2.4
overrides==7.7.0
packaging==24.0
pandocfilters==1.5.1
parso==0.8.4
pathlib2==2.3.7.post1
pathtools==0.1.2
pexpect==4.8.0
platformdirs==4.2.2
pluggy==1.5.0
ply==3.11
prometheus_client==0.20.0
promise==2.3
prompt-toolkit==3.0.43
proto-plus==1.23.0
protobuf==4.24.3
psutil==5.9.8
ptyprocess==0.7.0
pure-eval==0.2.2
py==1.11.0
py-spy==0.3.14
pyarrow==16.1.0
pyasn1==0.6.0
pyasn1_modules==0.4.0
pycparser==2.22
pycryptodomex==3.20.0
pydantic==2.7.1
pydantic_core==2.18.2
Pygments==2.18.0
PyJWT==2.8.0
pyOpenSSL==24.1.0
pyparsing==3.1.2
pytest==6.2.5
python-consul==1.1.0
python-dateutil==2.9.0.post0
python-engineio==4.9.1
python-etcd==0.4.5
python-json-logger==2.0.7
python-socketio==5.11.2
PyYAML==6.0.1
pyzmq==26.0.3
qtconsole==5.5.2
QtPy==2.4.1
referencing==0.35.1
requests==2.32.2
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rpds-py==0.18.1
rsa==4.9
schedule==1.2.1
Send2Trash==1.8.3
sentry-sdk==2.3.0
setproctitle==1.3.3
shortuuid==1.0.13
simple-websocket==1.0.0
smmap==5.0.1
sniffio==1.3.1
soupsieve==2.5
stack-data==0.6.3
terminado==0.18.1
thriftpy2==0.5.0
tinycss2==1.3.0
toml==0.10.2
tomli==2.0.1
tornado==6.4
tox==3.28.0
tqdm==4.66.4
traitlets==5.14.3
types-python-dateutil==2.9.0.20240316
typing_extensions==4.11.0
uri-template==1.3.0
uritemplate==4.1.1
urllib3==2.2.1
virtualenv==20.26.2
wandb==0.17.0
watchdog==4.0.0
wcwidth==0.2.13
webcolors==1.13
webencodings==0.5.1
websocket-client==1.8.0
widgetsnbextension==4.0.10
wrapt==1.16.0
wsproto==1.2.0
y-py==0.6.2
ypy-websocket==0.8.4
zipp==3.18.2
Originally posted by @Luodian in google-gemini/generative-ai-python#360
hi,
I tried the normal request module and browserified it. Everything worked fine in the browser.
Am I missing something? Why would one use browser-request instead of request?
Thank you
Hi
Thanks for this convenient library that allows me to use a single codebase on browser & node! I'm using this with browserify, but I've had to remove a few things from request.js
:
require('./xmlhttprequest')
— that file is not in the current directoryXHR.name !== 'cXMLHttpRequest'
browserify
key to package.json
. A main
key would help as well here.Do you understand the issues or do you want me to draft a pull request?
This is really annoying when I want to move into a production setting.
currently the responses are strings.. they should be json objects.
in node request, if I add json:true, I get a json object in resopnse
The baseUrl default is not working. It always use the current location
request.defaults({
baseUrl:'http://www.api.com'
})
With 30 Issues Opened and 31 Pull requests, I am wondering if this library is still maintained by anyone and if not, what could be the implications of using it in the long-term?
Given a cross domain request:
request({url: "http://pizza.com/api"}, function(e,r,b) {
console.log(e,r,b)
})
e
and b
are null
request({url: "http://pizza.com/api", json:true}, function(e,r,b) {
console.log(e,r,b)
})
e
is a JSON parse syntax error and b
is null
Would it be possible to detect and return an error about the single origin policy?
In Chrome the following code works.
In Firefox I get the error :
Error: CORS request rejected
With the code :
use strict';
var request =require('browser-request');
var url = 'http://docs.google.com/spreadsheets/export?id=1-on_GfmvaEcOk7HcWfKb8B6KFRv166RkLN2YmDEtDn4&exportFormat=csv';
request(url, function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log('success fetch');
console.log(response.statusCode);
console.log(body);
}else{
console.log(error + ' ' + response.statusCode );
}
});
when I mark json:true, I see the body is written.
this makes the code not compatible with node version.
in node version I mark json:true to get the response as json. I don't send anything on the body, and I must not write anything on the body (the REST API I use fails if I do, as it expects an empty body).
By default browser-request is async but I don't see any obvious way to make it sync. I have two functions, getHTTP
and HTTPExists
, but I also want to make getHTTPSync
and HTTPExistsSync
.
What are my options to make them sync?
function HTTPExists(url, cb) {
request({ url: resolve(url), method: 'HEAD' }, function(err, res) {
if (err) return cb(null, false);
cb(null, /4\d\d/.test(res.statusCode) === false);
});
}
function getHTTP(url, cb) {
request(resolve(url), function (error, response, body) {
if (!error && response.statusCode == 200) {
cb(null, body);
} else {
cb(error, body)
}
})
}
Requires are failing for me using ender and 0.20
request = require('browser-request');
and
request = require('request')
failing with
Ender Error: Requested module 'browser-request' has not been defined.
and
Ender Error: Requested module 'request' has not been defined.
here's my ender build header
/*!
Some encoding issue
---------------------------------702453823
Content-Disposition: form-data; name="profile_picture"
[object Object]
---------------------------------702453823--
Which is the master branch to the NPM package https://www.npmjs.org/package/browser-request which has been updated just 2 months ago where i can see here on master, that the last commit/merge was in Feb. 2014?
Bearer authentication is not supported.
In latest version of request, when bearer value is provided in auth, it should send a bearer authentication.
eg.
request.get('http://some.server.com/', {
'auth': {
'bearer': 'bearerToken'
}
});
In Chrome, I get "Syntax Error: Unexpected end of input" when the server returns nothing.
Steps to reproduce:
request({
...
method: "POST",
json: { my: "data" }
}, ...);
When the server returns a 204, it doesn't return any data with it. However, line 215 tries to parse the empty string as JSON, which causes the error in Chrome.
What is the best way for me to POST some JSON, but expect nothing in return? Using the json
key always expects a JSON response from the server?
Hi I can't download a version of browser-request that works in browser from this repo. thanks
Using the browser-request module in IE11 causes an InvalidStateError to occur.
The request code looks like this:
var options = {
url: "....",
json: true,
timeout: 2000
};
request.get(options, function(err, res, obj) {
// Error occurs before here
});
I have a nodejs module that requires the "request" module which on the browser (via browserify) uses the browser-request module. I've mapped this module correlation in my package.json like this:
"browser": {
"request": "browser-request"
}
Note that the request actually appears to work just fine, but IE logs an error
Here is a screenshot of the error in IE11 Developer Tools
Do you have any plan to support Typescript typings and / or ES6 modules?
Hi, there is no way around these browser restrictions, isn't it?
Great library.
Does your library support cookies?
Thanks!
Not sure of the best way to work with browser-request to do stuff similar to https://github.com/mikeal/request#forms
Following the Usage instructions it seems like I should be able to avoid using Browserify by loading the browser-request JS file directly in HTML like so <script src="node_modules/browser-request/index.js"></script>
and then in another JS file that is loaded beneath it, using browser-request by calling window.request
(HTML comment in Usage instructions reads "Assigns the module to window.request"). Apparently I am misinterpreting that because window.request
is undefined. Can someone please explain to me how to use this without needing to use Node's require()
and Browserify? I have confirmed that node_modules/browser-request/index.js
is being loaded by the browser.
Thank you.
There is a problem with usernames/passwords with special chars like ä,ö,ü.
The problem is this part:
https://github.com/iriscouch/browser-request/blob/master/index.js#L433-L472
If i take the function from the original request lib it works:
https://github.com/request/request/blob/master/lib/helpers.js#L45-L47
When setting json: true
if the status code is 0 an error will be thrown due to there being no responseText.
If I specify 'json:true' and 'headers: { 'Content-Type' : 'application/json' }
the outgoing Content-Type header value is application/json,application/json.
I need to be able to override the Content-Type completely.
if header Content-Type is specified, you should ignore it and not modify it.
// good
console.log(window.XMLHttpRequest);
var request = require('browser-request');
// undefined
console.log(window.XMLHttpRequest);
Just a heads up to my fellow developers - If you're using browser-request on a page that injects New relic RUM scripts (http://newrelic.com/browser-monitoring) - your XHR's are going to break, since New Relic is replacing the XMLHttpRequest prototype, and not adding the request state constants back in.
I'm tired of looking at "Response body loading" and friends. Should I just send a pull request disabling LOG.debug?
we should think about a strategy for merging this in to the main request repository.
there is a good amount of code now that can be shared, the OAuth signing code in particular.
i'd also like new options that people write for node-request to go in to the browser version.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.