Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom headers #23

Open
ochicaud opened this issue Jul 16, 2020 · 6 comments
Open

custom headers #23

ochicaud opened this issue Jul 16, 2020 · 6 comments

Comments

@ochicaud
Copy link

Hello,
Great job,
But could you implement the custom headers feature like you did in the 1.3.0.8 ?

It's very usefull to authentify with a single token

Thanks

@meancrazy
Copy link
Owner

Are you talking about the URL + settings window? This was taken from LINQPad, but in the .net core version we have separate UI & Driver layers. I'll ask Joseph Albahari about this feature, but ...

@ochicaud
Copy link
Author

ochicaud commented Oct 2, 2020

I just saw your answer.
I was talking about this : https://1drv.ms/u/s!AkvMv3MGtkjSr9A_BjMZvA4Wfm9mHg?e=znf34F

@Rogn
Copy link

Rogn commented Oct 22, 2020

Firstly, great driver :)

This functionality is also something we are missing compared to the 1.3.0.8 version.
When using the OData endpoint in MS Business Central, you need to specify the current company you work under. That can either be specified in the URL e.g. api/v1.0/$metadata#companies(4ec49869-7fc4-4a8e-8b4e-798f8b58e470) or as a custom header parameter.
If trying to use the URL option, we receive the following error:
image
And adding a custom header is currently not supported

@Rogn
Copy link

Rogn commented Nov 9, 2020

I am currently getting around this by adding the required header to all outgoing request using fiddler.
Something similar to:

if (oSession.uriContains("bc_api")) { oSession.oRequest["company"] = "eaf148df-10a3-48b5-a1cd-f5564115cfee"; }

@komdil
Copy link

komdil commented Feb 26, 2021

Till completing PR for LinqPad6 you can install it from offline nuget packages. Here is nuget: https://github.com/komdil/LINQPadOData4/blob/customHeadersWithNuget/NUGET/Nuget.zip

@Rogn
Copy link

Rogn commented Mar 16, 2021

Thanks @komdil,
I just tested this and it works perfect.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants