Giter VIP home page Giter VIP logo

Comments (10)

Huachao avatar Huachao commented on May 22, 2024 1

@StephD I am just curious the reason. Thanks for your usage of my extension and many great suggestions.

from vscode-restclient.

Huachao avatar Huachao commented on May 22, 2024

Thanks @StephD , I will look into this bug and update in this thread ASAP

from vscode-restclient.

Huachao avatar Huachao commented on May 22, 2024

@StephD I think this error is thrown from the http library I use or even the nodejs internal. Could you please provide me the error call stack by clicking 'Toggle Developer Tools'? And can I test your API from my side, or a public API that you can repo the error, maybe I need to use tool like WireShark to capture the tcp/http packet

from vscode-restclient.

StephD avatar StephD commented on May 22, 2024

debugViewer.ts:933 Parse Error
e.doShow @ debugViewer.ts:933
e.show @ debugViewer.ts:907
(anonymous function) @ main.contribution.ts:36
i.Class.derive._oncancel @ monarchCompile.ts:91
t.$showMessage @ main.contribution.ts:33
e.handle @ window.ts:48
s @ commonCodeEditor.ts:925
f @ commonCodeEditor.ts:977
_combinedTickCallback @ internal/process/next_tick.js:67
_tickCallback @ internal/process/next_tick.js:98

Good luck with that :)
Unfortunately, you can't try it from your side.

The different between with and without exit is that the content type is text/plain with exit and text/xml without.
In both case, the response is the content of the file. But without exit, response also contain an xml part.

2016-08-24 14_02_20-firebug - rest easy
2016-08-24 14_02_47-firebug - rest easy

What I want to ask is the possibility to get the raw version of the response.
2016-08-24 14_04_37-rest easy - firefox developer edition
2016-08-24 14_04_31-rest easy - firefox developer edition

This error is generated from the server side (content-type, ..) so thanks to you, I can know that something goes wrong.
But I just ask you for raw functionality :)

EDIT : I found the error on my side. "exit" must be added to download file.
Btw, I keep the proposition to display the raw response if the parsing doesn't work, or the text without parsing.
For me, you can close this request and add a proposition about the raw value.
Thanks

from vscode-restclient.

Huachao avatar Huachao commented on May 22, 2024

@StephD however I can't repro your failure by get a invalid xml file with content-type: text/html;charset=UTF-8. You can try to get this file GET https://humao1576.blob.core.windows.net/test/test.txt HTTP/1.1

from vscode-restclient.

StephD avatar StephD commented on May 22, 2024

You are correct, on your server, even if it's the same error with resteasy, vscode do not give me any parsing error.

I don't know. Thanks for your time

from vscode-restclient.

Huachao avatar Huachao commented on May 22, 2024

@StephD So I still guess, the so-called Parse Error is from the node js http library which parses the response and find the response invalid, the invalid here seems not related to wrong content body, but should related to http response format. Maybe if you don't exit in your php code, the server maybe generate some invalid content in response, which cause nodejs http library error.

Below are my guess:

  1. Will the response body in fact is larger than 9(in your example) which causes the Parse Error
  2. Can you add a request header Connection:keep-alive to test the vscode rest client behavior

from vscode-restclient.

StephD avatar StephD commented on May 22, 2024

1: Response length modification let appear xml part : Test file
2: Connection:keep-alive do not change anything in vscode

from vscode-restclient.

Huachao avatar Huachao commented on May 22, 2024

@StephD according to your first screenshot, the Content-Length returned from the server seems 9, and in your case as your mentioned above, the Content-Length shall be larger than 9 due to xml header? Can you try to make the Content-Length header reflects the real length? If I am wrong, sorry for the inconvenience.

from vscode-restclient.

StephD avatar StephD commented on May 22, 2024

I did it. I put it to 100 to let appear this xml part. This is why there is a parsing error I think because as xml, it's invalid.
Btw. Like I said, there was an error in my code so this error come from me, not your extension.

from vscode-restclient.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.