Comments (8)
Hi @p-mathias,
query params belong to the responsibility of the used HTTP client.
I would imagine that you're using the JqueryHttpClient
as it is about SAP.
For axios and fetch there are options readily available which can be set on a global level when intializing the HTTP client.
Axios example:
new AxiosHttpClient({params: {"sap-client": "200"})
I'm astonished to see that it's not that easy regarding jQuery. It looks like you can use the prefilter option for that use case. Then along these lines:
$.ajaxPrefilter(function( options ) {
options.url = options.url + "?sap-client=200";
}
});
Probably you would need to do a bit more logic here => when querying, then you need to check if the "?" becomes a "&"...
I'll ponder a bit, if this can be easily built-into the jqueryHttpClient.
If you have any suggestions regarding improvements of the docs in this respect...
from odata2ts.
Well jquery is fare away from being in scope for me,
atm i try my luck with fetch api,
but doesn't got working solution done.
from odata2ts.
Hi p-mathias,
ah ok, so this is also missing in the fetch client.
I'll add this option to both clients then as constructor param (see Axios example).
from odata2ts.
Hi @p-mathias,
I've added appropriate options for the fetch and jquery http client.
For fetch it would like:
new FetchClient({params: {"sap-client": "200"}}); // actually doesn't matter if you use "200" or 200 as number
Released with @odata2ts/http-client-fetch
version 0.5.0
.
Please try it out and close this issue if it works.
from odata2ts.
okay i will do it
mention repo: https://github.com/odata2ts/http-client
from odata2ts.
0.5 doesn't got released so i can't test this: https://www.npmjs.com/package/@odata2ts/http-client-fetch
from odata2ts.
WTF?! You're right, I've just released those versions.
Sorry for the inconvenience...
from odata2ts.
works fine
from odata2ts.
Related Issues (20)
- Error/Bug client.retrieveBigNumbersAsString do not exist HOT 4
- [Enhancement suggestion] Config parameter for using “Emulation of In Operator”
- [Enhancement suggestion] Reduce bundle size by only use odata V2 or V4. HOT 2
- [Enhancement suggestion] TanStack (react-query/vue-query) compatibility HOT 1
- CSRF Token get not fetched (with fetch client) HOT 8
- auto CSRF function get confused by body HOT 5
- Post over fetch doesn't work, maybe content type wrong HOT 2
- [Enhancement suggestion] OData V2 : add the entitySet interfaces HOT 3
- For optional types, undefined is more appropriate than null using typescript. HOT 3
- Same Name in Different Namespaces Throws Error HOT 13
- [Feature Request]OData V3 Support HOT 11
- [Feature Request] generated types also for the Entity Container HOT 6
- load component issue with Odata V2 HOT 5
- [Feature Request] Deep Insert/Update support HOT 5
- [Usage Question] Addition of query parameters HOT 5
- Issue with Handling Keyless Entities in Microsoft Dynamics OData V4 API HOT 9
- [Bug Report] Filltering with ranges HOT 2
- [Bug Report] TypeScript: `RangeError: Maximum call stack size exceeded` HOT 9
- Very slow generation on big schema HOT 3
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 odata2ts.