qmacro / qmacro.github.io

MIT License
4 stars 4 forks source link

OData query operations and URL encoding the system query options with curl | DJ Adams #55

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

OData query operations and URL encoding the system query options with curl | DJ Adams

OData query operations and URL encoding the system query options with curl 08 Aug 2023 | 4 min read You can use curl to send OData query...

https://qmacro.org/blog/posts/2023/08/08/odata-query-operations-and-url-encoding-the-system-query-options-with-curl/

bztoy commented 1 year ago

Hi DJ,

Now, typically, one might say normally, these options are used in the case of POST requests, where the data is sent in the body of the request, i.e. in the payload.

You are absolutely right about the above quote because I was one who thought like that and use the --data-urlencode option only in a POST request when I use curl. 😂😂

back to the --get option, what a cool option. This is a life saver (at least for me) and what I should know for a long time.

Previously, there were so many circumstances that I want to provide something in the URL more than a query string or query parameters in a HTTP GET call with curl (like during the time that I was learning about OData or some BTP learning courses for example).

At that time, I was unable to give curl in a correct URL format then I decided to switch to other tools for example those VSCode extensions like the REST Client or the Thunder Client .

Once again, a new day and I learn a new thing. Thanks for your kindness, you are a great teacher.

Thanks, Wises

javiexpo commented 1 year ago

Hi Dj,

Would be possible for you to provide and example of an OData GET request but including the authentication process for an OData that is protected with OAuth 2.0 mechanism ?

This could help us a lot on writing shell scripts to manage BTP Services or consuming API.

Kind regards

qmacro commented 6 months ago

Sorry for not seeing or responding to this earlier, @javiexpo ! Incidentally I just published https://qmacro.org/blog/posts/2024/05/08/obtaining-auth-code-grant-type-oauth-2.0-tokens-for-google-apis-with-a-script/ which may help?