Comments (3)
Hi Karsten,
Thanks for reporting this issue. However, I'm not able to reproduce the behavior you describe.
j←Jarvis.New '' ⍝ create a new Jarvis server
j.Paradigm←'REST' ⍝ set the Paradigm
⍝ now define some endpoints
Get←{⍵.(Method Endpoint Body)}
Post←{⍵.(Method Endpoint Body)}
Delete←{⍵.(Method Endpoint Body)}
j.Start
Start[3] 2024-02-08 @ 12.53.33.486 - Starting Jarvis 1.16.3
LoadConga[32] 2024-02-08 @ 12.53.33.501 - Conga copied from C:\Program Files\Dyalog\Dyalog APL-64 18.2 Unicode/ws/conga
LoadConga[44] 2024-02-08 @ 12.53.33.501 - Local Conga v4.3 reference is #.Jarvis.[LIB]
Start[83] 2024-02-08 @ 12.53.33.517 - Jarvis starting in "REST" mode on port 8080
Start[84] 2024-02-08 @ 12.53.33.520 - Serving code in #
0 Server started
⍝ I use HttpCommand to test
h←HttpCommand.New ''
h.BaseURL←'localhost:8080'
h.(Command URL)←'Get' 'getme'
h.Show
GET /getme HTTP/1.1
Host: localhost:8080
User-Agent: Dyalog-HttpCommand/5.4.4
Accept: */*
Accept-Encoding: gzip, deflate
h.Run.Data ⍝ run it and return the response payload
["get","/getme",""]
h.(Command URL)←'post' 'postme' ⍝ now try POST
h.Run.Data
["post","/postme",""]
h.(Command URL)←'delete' 'deleteme' ⍝ now try DELETE
h.Run.Data
["delete","/deleteme",""]
Have you verified that Jarvis is getting the requests? You can set Debug←2
on the Jarvis instance and it will stop just prior to calling any of your code.
I hope this helps!
/Brian
from jarvis.
Fixed in a02f514 (release v1.17.0).
This was an interesting issue. Because of the discrepancy in behavior between what Karsten was seeing with Insomnia and what I was seeing using HttpCommand, I decided to investigate further and installed Insomnia. There is a subtle difference in behavior between the two:
- When using HttpCommand to test, Conga generates the "content-length" header for the request. If there's no content, Conga doesn't bother to include this header.
- Insomnia on the other hand generates a "content-length: 0" header.
Jarvis was not picking up on the "content-length: 0" header and as such was expecting an HTTPBody event, which never came, and so the system seemed to hang.
from jarvis.
Thanks a lot. Good work. That was all a needed.
I dived a little bit into the http protocol and found the following:
https://www.rfc-editor.org/rfc/rfc7230#section-3.3.3
Especially starting with Point 4, it becomes more complicated.
Karsten
from jarvis.
Related Issues (20)
- Web interface fails if exposed functions contain ∆
- Allow .apla (APL array) files to be loaded
- EndPoints needs to be ⎕ML/⎕IO insensitive
- Don't close connection for in-process request
- Add MaxPayloadSize setting
- Return 431 status when headers are too large HOT 1
- Any chance of supporting GZip, deflate please. HOT 1
- Bug in running secure server
- Implement better handling in event where user fails the request
- Update Workspaces for Dyalog 17.0 Compatibility
- Add support for Swagger UI HOT 2
- Provide setting to kill request-handling thread on connection close
- Simpler `sint` HOT 1
- Seemingly random crashes related to "OSError" "Undefined name: CON000000XX" HOT 6
- Update Jarvis container to run under v19 HOT 2
- Incorrect Conga Version Reported On Starting Server
- Pipelining Causes Server Error HOT 3
- Jarvis Test Suite HOT 1
- Jarvis Threading Model HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jarvis.