Git Product home page Git Product logo

Comments (6)

josevalim avatar josevalim commented on July 24, 2024 2

@thecristen when plug matches on *_whatever, the actual path is on _whatever. You should be able to change it afterwards in any way you want so you don't submit exactly _whatever to the API.

from plug.

josevalim avatar josevalim commented on July 24, 2024 1

@thecristen you should be able to write: /1/indexes/*_unused/queries or even /1/indexes/*_unused. Whatever follows * is going to be the name of the variables where the remaining paths will be assigned to. Then you can still access the whole path in the connection and send it to the 3rd party.

from plug.

whatyouhide avatar whatyouhide commented on July 24, 2024

Heyo, thanks for the issue.

I think the issue might be that you need to follow * with a variable name, not a suffix:

CleanShot 2023-01-18 at 08 31 18@2x

If this is the case, we need to improve the error message.

Also, I'm confused on a thing: do you want to send /1/indexes/*/queries as is to the 3rd party, or the * is still meant to be a match, and you want to send URLs such as /1/indexes/foo/queries?

from plug.

thecristen avatar thecristen commented on July 24, 2024

Thanks for the response; to clarify, I want to (need to) send /1/indexes/*/queries as is to the 3rd party.
It's not so much a route that's part of my own application, but my application happens to be making a HTTPoison.post to the third-party URL that happens to have the "/1/indexes/*/queries" path. Hope this helps!

from plug.

thecristen avatar thecristen commented on July 24, 2024

Thanks @josevalim I will give it a try. 😄
Also my bad for pointing to Plug 1.14, as I just found I can reproduce with 1.12.1.

from plug.

thecristen avatar thecristen commented on July 24, 2024

Well, that works as a workaround for the sake of my tests, but I'd have to adjust it in prod since the API I'm POSTing to doesn't support a "/1/indexes/*_whatever/queries" path.

from plug.

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.