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

TypeError: str.replace is not a function #189

Open
DTPhil opened this issue Aug 24, 2017 · 1 comment
Open

TypeError: str.replace is not a function #189

DTPhil opened this issue Aug 24, 2017 · 1 comment

Comments

@DTPhil
Copy link

DTPhil commented Aug 24, 2017

I am getting the following error:

node_modules/request/lib/querystring.js:44
  return str.replace(/[!'()*]/g, function (c) {
             ^
TypeError: str.replace is not a function
    at Querystring.rfc3986 (/Users/user/GoogleDrive/NewProject/API/codegen_JS/node_modules/request/lib/querystring.js:44:14)
    at Request.json (/Users/user/GoogleDrive/NewProject/API/codegen_JS/node_modules/request/request.js:1305:30)
    at Request.init (/Users/user/GoogleDrive/NewProject/API/codegen_JS/node_modules/request/request.js:406:10)
    at new Request (/Users/user/GoogleDrive/NewProject/API/codegen_JS/node_modules/request/request.js:130:8)
    at request (/Users/user/GoogleDrive/NewProject/API/codegen_JS/node_modules/request/index.js:54:10)
    at DataTiger.request (/Users/user/GoogleDrive/NewProject/API/codegen_JS/nodejsSourceCode.js:73:9)
    at DataTiger.getApplications (/Users/user/GoogleDrive/NewProject/API/codegen_JS/nodejsSourceCode.js:211:14)
    at Object.<anonymous> (/Users/user/GoogleDrive/NewProject/API/codegen_JS/test.js:24:11)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)

When I comment out:
//headers['Content-Type'] = ['application/x-www-form-urlencoded'];
it works.

This seems to be an error with the library. Maybe this can be fixed via a change of headers?

Thanks!

@Sudhakar12297
Copy link

Yeah just remove the header. It will work fine

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

No branches or pull requests

2 participants