How to send REST API GET request with headers in Business Central

Linaelsadek
Member Posts: 2
Hello,
I am currently trying to send a GET request to a service through REST API. The request in itself is working correctly. However, for this request to return data, I need to send a login token. The issue is that I cannot add request headers in a GET request.
Any suggestions/workaround for this issue?
Thank you in advance
I am currently trying to send a GET request to a service through REST API. The request in itself is working correctly. However, for this request to return data, I need to send a login token. The issue is that I cannot add request headers in a GET request.
Any suggestions/workaround for this issue?
Thank you in advance
0
Answers
-
See of this helps
https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-connect-apps-tipsThanks
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/0 -
Thank you for your reply. After some more digging I found out I had to add a Cookie header to the HttpClient variable. The problem with that is that the HttpClient overrides the Cookie header so the login token I'm attempting to send is not being received by the service. Other people have experienced this issue and requested this feature to be added, but it needs enough votes for it to be implemented in Business Central. Here is the link to it for anyone that is interested: https://experience.dynamics.com/ideas/idea/?ideaid=6e80f42d-8b43-ea11-b698-0003ff68dcf80
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions