Comments (8)
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.
Oh, and thanks for the input.. 👍
from ain.
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.
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.
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.
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.
Thank you very much for including the new [Query] section 😀
from ain.
excellent, now i update ain
from ain.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ain.