Coder Social home page Coder Social logo

Comments (3)

bpbecker avatar bpbecker commented on July 29, 2024

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.

bpbecker avatar bpbecker commented on July 29, 2024

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.

kdtp avatar kdtp commented on July 29, 2024

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)

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.