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

Parse url incorrectly when contains space #63

Closed
infinisuite opened this issue Jan 19, 2017 · 3 comments
Closed

Parse url incorrectly when contains space #63

infinisuite opened this issue Jan 19, 2017 · 3 comments
Labels

Comments

@infinisuite
Copy link

Executing a rest call that includes json with REST Client mangles any json element with a space in the contents. Running the same call with Postman works.

  • VSCode Version: Version 1.8.1 (1.8.1)
  • OS Version: OSX 10.12.2 (16C67)
  • REST Client Version: v0.12.0

Steps to Reproduce:

Parse and execute (get) this rest call:

GET http://localhost:8080/api/transaction_view/?filter={"fields":{"rowid":true,"transactiondate":true,"description":true,"totalamount":true},"where":{"or":[{"and":[{"transactiondate":{"gte":"2016-12-01"}},{"transactiondate":{"lte":"2017-01-01"}}]}]},"order":"rowid desc"}
token: sd0iwer90sdflksdf

The string that REST Client is actually sending to the server is:
"{"fields":{"rowid":true,"transactiondate":true,"description":true,"totalamount":true},"where":{"or":[{"and":[{"transactiondate":{"gte":"2016-12-01"}},{"transactiondate":{"lte":"2017-01-01"}}]}]},"order":"rowid"

Note that "order":"rowid desc"} has been changed to "order":"rowid"

@infinisuite infinisuite changed the title Characters Being Truncated Json Characters Being Mangled Jan 19, 2017
@Huachao Huachao added the bug label Jan 20, 2017
Huachao added a commit that referenced this issue Jan 20, 2017
@Huachao
Copy link
Owner

Huachao commented Jan 20, 2017

@infinisuite I have fixed the bug and will publish in next release. The root cause is that the request line contains space in url, here is the space after rowid. Currently, you can work around by making query string in another line, like:

GET http://localhost:8080/api/transaction_view/
?filter={"fields":{"rowid":true,"transactiondate":true,"description":true,"totalamount":true},"where":{"or":[{"and":[{"transactiondate":{"gte":"2016-12-01"}},{"transactiondate":{"lte":"2017-01-01"}}]}]},"order":"rowid desc"}
token: sd0iwer90sdflksdf

This should be work now.

@Huachao Huachao changed the title Json Characters Being Mangled Parse url incorrectly when contains space Jan 20, 2017
@Huachao Huachao closed this as completed Jan 20, 2017
@Huachao
Copy link
Owner

Huachao commented Jan 25, 2017

@infinisuite you can try the latest version 0.12.1 to verify it, thanks for your feedback 😃

@infinisuite
Copy link
Author

Thanks!

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

No branches or pull requests

1 participant