GithubHelp home page GithubHelp logo

Parameters with x-www-form-urlencoded are not included in the curl commandline and are not sent about loopback-component-explorer HOT 5 CLOSED

fs523577192 avatar fs523577192 commented on July 18, 2024
Parameters with x-www-form-urlencoded are not included in the curl commandline and are not sent

from loopback-component-explorer.

Comments (5)

bajtos avatar bajtos commented on July 18, 2024 1

I see. Can we get a sample app reproducing the problem please, so that we stop guessing? See https://github.com/strongloop/loopback/wiki/Reporting-issues#bug-report

from loopback-component-explorer.

superkhau avatar superkhau commented on July 18, 2024

I'm running into the same issue for API explorer at loopbackio/loopback-datasource-juggler@a65504b for PUT requests using source: 'form' for remoting.

from loopback-component-explorer.

superkhau avatar superkhau commented on July 18, 2024

Also see comment at strongloop/loopback#2770 (comment)

from loopback-component-explorer.

bajtos avatar bajtos commented on July 18, 2024

There is no "-d" option in the curl command and I get the response with message "The 'MyInterface' instance is not valid. Details: 'name' can't be blank (value: undefined); 'url' can't be blank (value: undefined).", which I believe is caused by not sending the posted form data.

This makes perfect sense to me. Because your client send an empty request body, the server rejected the request with a validation error.

The solution is to add (possibly multiple) -d options to curl:

curl -X POST --header "Content-Type: application/x-www-form-urlencoded" \
  --header "Accept: application/json" \
  -d name=Login%20Preparation -d url=%2Flogin \
  "http://127.0.0.1:3000/api/MyInterfaces"

@fs523577192 I may be misunderstanding your bug report. What are you trying to accomplish? What behaviour did you expect from LoopBack?

from loopback-component-explorer.

superkhau avatar superkhau commented on July 18, 2024

@bajtos I believe he is talking about the curl line that shows up in API explorer. I ran into the same issue when issueing PUT with form. I expected the curl output from the UI to show -F or -d for JSON, but it simply shows no -d or -F flag and sends no data with the request.

from loopback-component-explorer.

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.