Avatar of Andy Green
Andy GreenFlag for United Kingdom of Great Britain and Northern Ireland

asked on 

Adding a header value from code behind

Hi

I have an external API endpoint that receives a GET request with a querystring parameter of Id, this is used with an internal controller / service to get some more info about the subject (Internal Id), and is passed on through a secure gateway down to an internal controller.

How do I add an the Internal Id parameter to the header of the request goining down to the internal API. I cant use the querystring.

Any pointers would be great.

Andy
ASP.NETREST

Avatar of undefined
Last Comment
ste5an
Avatar of ste5an
ste5an
Flag of Germany image

You need to check the internal API, what it accepts. This is something we cannot know.
Avatar of Andy Green
Andy Green
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

Sorry for got to mention, I'll be coding these changes. SO I need to get the parameter into the header to pass on to the internal API, I'm hoping once I can get the param down to the lower API I'll be able to figure out how to read it. :-).

A
ASKER CERTIFIED SOLUTION
Avatar of Andy Green
Andy Green
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of ste5an
ste5an
Flag of Germany image

Just check the binding options. Look especially at the FromHeader attribute.

hmm, seems I forgot to press submit yesterday..
ASP.NET
ASP.NET

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications

128K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo