Giter Site home page Giter Site logo

Comments (8)

jonaslu avatar jonaslu commented on May 5, 2024 1

Ok. I've thought about this some. In the one-file case it's not worth introducing a new section as you actually need to type more. But in the cascading case where you have base-files and more specific files for different endpoints it does makes sense.

An example is where you need to pass an API_KEY= to a bunch of endpoints as a query parameter. Since URL:s currently combine you need to specify that API_KEY in each of the last files pased to ain to get it in as a query-parameter. This leads to duplication.

If there was a [QueryParams] section that would also combine, but be placed after the first ? then it could be specified in a base-file and not duplicated.

Same goes for any fragment in the URL.

I'll flesh out the details in the coming days.

from ain.

jonaslu avatar jonaslu commented on May 5, 2024 1

Oh, and thanks for the input.. 👍

from ain.

jonaslu avatar jonaslu commented on May 5, 2024 1

No problem. I changed so whitespace is not significant in the [Query] section in version v1.2.1

So these two are the same in v1.2.1 and onwards:

page=3
page = 3

from ain.

jonaslu avatar jonaslu commented on May 5, 2024

I'm not sure I follow, do you mean /api/v2/todos?page=3, so the page: 3 would turn into page=3?

from ain.

ericktucto avatar ericktucto commented on May 5, 2024

Currently sending the parameters that way /api/v2/todos?page=3 , create this issue as a proposal to separate the endpoint from the sent parameters

from ain.

jonaslu avatar jonaslu commented on May 5, 2024

So, I've added a [Query] section in ain v1.2.0. You can read up on the syntax here: https://github.com/jonaslu/ain#query

Note that parameters are written as they would be in an url with an equals sign (and whitespace within the key is significant):

page=3

It turns out i TIL that fragments are a client-side thing only and curl, wget and httpie ignores any fragment in the url, so I won't be doing those in the same way.

from ain.

ericktucto avatar ericktucto commented on May 5, 2024

Thank you very much for including the new [Query] section 😀

from ain.

ericktucto avatar ericktucto commented on May 5, 2024

excellent, now i update ain

from ain.

Related Issues (7)

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.