-
Notifications
You must be signed in to change notification settings - Fork 145
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
Error #35
Comments
Hey @mikaspell! const ajax = require('@fdaciuk/ajax')
// configuration for your request
const aQuery = ajax({
baseUrl: 'https://some-site/api/',
headers: { 'content-type': null }
})
// now, make the request
aQuery.post('/user/nop', {
password: res.dataValues.password,
username: res.dataValues.username
}) Let me know if it helped you =) |
@fdaciuk unfortunately it did not help |
Are you trying this locally? |
yes |
Which browser are you using? |
trace: i use Chrome |
here the problem is not likely to form in the request, and in that it requests a module that is mounted |
Yes.. really weird. Can you show me all your code? Is it on GitHub? |
@fdaciuk yeap |
@mikaspell The way i can see here you are trying to use the module inside Node.js environment not the browser. In that case you should use something like got or request |
@mikaspell , |
@luanmuniz thank you! and @fdaciuk sorry for distracts you |
No problem @mikaspell =) |
Hey. I caught this error
Unhandled rejection ReferenceError: XMLHttpRequest is not defined
in my controller i'm add your module like that:
ajax = require('@fdaciuk/ajax')
then
const aQuery = ajax({ baseUrl: 'https://some-site/api/'})
and then request
aQuery.post('/user/nop', { headers: { 'content-type': null }, data: { password: res.dataValues.password, username: res.dataValues.username } });
After I got the error I added:
XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest, xhr = new XMLHttpRequest()
and it did not help. Are there any ideas about this?
The text was updated successfully, but these errors were encountered: