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

Uncaught SyntaxError: Unexpected token : #36

Closed
yanlinaung30 opened this issue May 18, 2016 · 4 comments
Closed

Uncaught SyntaxError: Unexpected token : #36

yanlinaung30 opened this issue May 18, 2016 · 4 comments

Comments

@yanlinaung30
Copy link

yanlinaung30 commented May 18, 2016

[Enter steps to reproduce below:]

  1. Choose 'applicatioin/json'
  2. send

Atom Version: 1.7.3
System: Mac OS X 10.11.4
Thrown From: rest-client package, v1.1.0

Stack Trace

Uncaught SyntaxError: Unexpected token :

At file:///Applications/Atom.app/Contents/Resources/app.asar/static/index.html#%7B%22initialPaths%22%3A%5B%5D%2C%22locationsToOpen%22%3A%5B%7B%7D%5D%2C%22windowInitializationScript%22%3A%22%2FApplications%2FAtom.app%2FContents%2FResources%2Fapp.asar%2Fsrc%2Finitialize-application-window.js%22%2C%22resourcePath%22%3A%22%2FApplications%2FAtom.app%2FContents%2FResources%2Fapp.asar%22%2C%22devMode%22%3Afalse%2C%22safeMode%22%3Afalse%2C%22clearWindowState%22%3Afalse%2C%22appVersion%22%3A%221.7.3%22%2C%22atomHome%22%3A%22%2FUsers%2Fyanlinaung%2F.atom%22%7D:1

SyntaxError: Unexpected token :
    at Object.parse (native)
    at RestClientView.module.exports.RestClientView.getRequestBody (/Users/yanlinaung/.atom/packages/rest-client/lib/rest-client-view.coffee:281:27)
    at RestClientView.module.exports.RestClientView.getRequestOptions (/Users/yanlinaung/.atom/packages/rest-client/lib/rest-client-view.coffee:253:14)
    at RestClientView.module.exports.RestClientView.sendRequest (/Users/yanlinaung/.atom/packages/rest-client/lib/rest-client-view.coffee:228:24)
    at HTMLButtonElement.<anonymous> (/Users/yanlinaung/.atom/packages/rest-client/lib/rest-client-view.coffee:160:43)
    at space-pen-div.jQuery.event.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/jquery/dist/jquery.js:4435:9)
    at space-pen-div.elemData.handle (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/jquery/dist/jquery.js:4121:28)

Commands

     -0:26.5.0 core:select-all (textarea.field.rest-client-payload)
     -0:26 core:paste (textarea.field.rest-client-payload)

Config

{}

Installed Packages

# User
rest-client, v1.1.0

# Dev
No dev packages
@ddavison
Copy link
Owner

I am unable to reproduce.

I used the following:

URL: http://jsonplaceholder.typicode.com/posts
Method: POST
Payload: {"title": "some title", "body": "bar", "userId": 1}
MIME: application/json

screen shot 2016-05-18 at 10 19 34 am

@ddavison
Copy link
Owner

Please if you could, paste your payload (and sensor anything sensitive). I have a feeling your JSON isn't valid. might want to try putting your json payload through a JSONLinter

@yanlinaung30
Copy link
Author

@ddavison Thanks for your reply. It is right. JSON is not valid. String field does not have open & close inverted commas. It is OK when I put inverted commas. (y)

@ddavison
Copy link
Owner

oh perfect! I'm glad you figured it out :) thanks for opening an issue! If you find anything else, feel free to open another

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