-
Notifications
You must be signed in to change notification settings - Fork 295
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
fix(upload): return type on POST is now string #976
Conversation
This might be more of a suggestion - not all web services receiving a post returns JSON. Propose to leave result processing to the end-user |
Hmm, you're right with that, however we actually ignore the return value on the js side so we may as well return For that status error i'd prefer if you could add a new Error enum variant instead of using ContentLength Lastly, it would be much appreciated if you could apply the same to the download command after making those changes :) P.S. Thank you for contributing! |
Thanks for the feedback @FabianLars I somehow missed your response. I'll give it another shot hopefully soon |
@FabianLars Ok, I think that was all of your suggestions :) What do you think? |
.. my default linter formater apperantly is different that |
There's still this part open from above:
So if there's any value in the response body we'll also have to fix the js side to actually forward it to the user. |
@FabianLars You're right. It should be fixed now. I also added @lucasfernog suggestion. I'll do some extensive test, but I think this should finally be it 😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need a change file (a markdown file under the .changes folder) like this:
---
"upload": patch
"upload-js": patch
---
Return the upload response as a string and error out if the status code is not within 200-299.
Tried to push changes to your repo but i'm not allowed to :( |
@lucasfernog Thank you for your help, there are clearly some corners in the repo that are unknown to me. I've accepted you proposals in the Github UI. |
@lyager please also push the change file i mentioned above :) |
Thanks for the patience @lucasfernog , I've rebased and added the covector file you mentioned. |
idk why but the diff is crazy right now :( something went wrong with your rebase |
A POST to a webserver can not always be expected to be a JSON response. Success is now determined by the HTTP return code. Upon success the body content is returned as a string.
Not all embedded devices are acceptable to receiving unspecified amounts of data. Appending the content-length up front helps this devices succeed.
The return values was not used. On POST the HTTP error code is returned as an enum.
Co-authored-by: Lucas Fernandes Nogueira <[email protected]>
Co-authored-by: Lucas Fernandes Nogueira <[email protected]>
@lucasfernog I've rebased against v1, now only 3 files have changed.. Sorry about that, and thank you for your patience. |
ain't nobody got time for that (i'm merging the last v1 prs. we can iterate over them again when we merge v1 into v2)
A POST to a webserver can not always be expected to be a JSON response.
Success is now determined by the HTTP return code.
Upon success the body content is returned as a string.