Git Product home page Git Product logo

Comments (6)

yakovkhalinsky avatar yakovkhalinsky commented on August 29, 2024

Hey @deanmraz sorry to hear your having trouble.

Are you running it as middleware or from the command line?

Can you paste in the command you are running?

from drakov.

yakovkhalinsky avatar yakovkhalinsky commented on August 29, 2024

Oh and any output you are getting would be useful as well, thanks

from drakov.

deanmraz avatar deanmraz commented on August 29, 2024

@yakovkhalinsky I've done both, started with the middleware and checked to see if the command line was working. Most of the GET methods work but haven't been able to run any POST, PUT or DELETE.

I've even tested the examples in the test. The /api/multiple doesn't seem to work for both GET & POST, I get these errors:
Cannot GET /api/multiple
Cannot POST /api/multiple

This is the command I ran:
drakov -f "node_modules/drakov/test/example/md/multiple-examples-api.md"

Running:
Node v0.10.32
Drakov 0.1.3

@yakovkhalinsky thanks for the help!

from drakov.

marcelogo avatar marcelogo commented on August 29, 2024

@deanmraz

Please note that some headers are mandatory in order to get the response described in the md file.

The first GET requires a Custom-header: First to be set.

+ Request

    + Headers

        Custom-header: First

The same situation occurs for the POST method. Two things are required:

  • The Content-Type header with application/json
  • The body with {"first": "example"}
### Post to the first example [POST]

+ Request (application/json)
First POST example with body 

    + Body

        {"first": "example"}

Could you please check it and let us know how it goes?

You can also refer to our tests. Note that multiple-examples-api-test.js sends all the required information on the requests.

from drakov.

yakovkhalinsky avatar yakovkhalinsky commented on August 29, 2024

@deanmraz how are you sending the POST, PUT and DELETE message?

Are you using curl or something like postman?

from drakov.

deanmraz avatar deanmraz commented on August 29, 2024

@yakovkhalinsky using postman

@marcelogo that was it, didn't have the right headers.

Thank you both and much appreciated!

from drakov.

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.