---
id: change/bcapps/12614
type: change
title: "#12614 [GB] GovTalk: migrate SendHttpRequest from DotNet HttpWebRequest to native HttpClient"
summary: GovTalk message submission migrated from deprecated DotNet HttpWebRequest to native HttpClient for HTTP communication with HMRC.
tier: official
language: en
tags:
  - refactor
  - main
  - bc30
  - codeunit govtalk message management
  - codeunit govtalkmessagemanagement
system: finance
review:
  state: reviewed
  by: opus
  at: "2026-10-16T01:17:25.385Z"
  flags: []
generated:
  at: "2026-10-24T01:02:25.817Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 29560b95d833f337e926aac066d8e043d6cfc1de
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/12614
    title: "microsoft/BCApps#12614: [GB] GovTalk: migrate SendHttpRequest from DotNet HttpWebRequest to native HttpClient"
    date: "2026-10-13"
    commit: 29560b95d833f337e926aac066d8e043d6cfc1de
    t: null
    quote: null
links:
  learn: []
  objects:
    - object/codeunit/10569-gb
    - object/codeunit/10520-gb
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/devenv-httpclient
      title: Call external services with the HttpClient data type
      label: possibly related
      why: Explains how to use HttpClient data type for HTTP requests, directly relevant to migration from DotNet HttpWebRequest
      by: model
    - to: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/administration/telemetry-webservices-outgoing-trace
      title: Outgoing Web Service Request Trace
      label: possibly related
      why: Documents outgoing web service request telemetry for HTTP calls, applicable to GovTalk SendHttpRequest implementation
      by: model
number: 12614
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/12614
kind: pr
base_branch: main
major: "30"
merged_at: "2026-10-13T15:45:03Z"
author: darjoo
author_type: User
community_contribution: false
labels:
  - "Team: Finance"
change_class: code
change_kind: refactor
behavior_change: true
breaking: false
files:
  count: 3
  additions: 219
  deletions: 50
  al: 2
apps:
  - Base Application
  - GovTalk
objects_touched:
  - key: codeunit/10569
    page: codeunit/10569-gb
    type: codeunit
    id: 10569
    name: GovTalk Message Management
    app: GovTalk
    status: modified
  - key: codeunit/10520
    page: codeunit/10520-gb
    type: codeunit
    id: 10520
    name: GovTalkMessageManagement
    app: Base Application
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 647963
systems:
  - finance
quote: null
joined_against:
  major: "30"
  commit: f18567dc08e2bd162bf192e1da4d714b57eb099f
---

# #12614 [GB] GovTalk: migrate SendHttpRequest from DotNet HttpWebRequest to native HttpClient

> GovTalk message submission migrated from deprecated DotNet HttpWebRequest to native HttpClient for HTTP communication with HMRC.

[Pull request](https://github.com/microsoft/BCApps/pull/12614) · merged into `main` (BC30) on 2026-10-13 by darjoo · 3 files (+219 -50), 2 AL · refactor · tier official · reviewed (checked by Opus)

## What changed

- SendHttpRequest now uses native HttpClient, HttpRequestMessage and HttpResponseMessage instead of DotNet HttpWebRequest via Web Request Helper
- The same migration is applied to the GovTalk app (codeunit 10569) and the obsolete GB Base App copy (codeunit 10520)
- Admin controls on outbound extension HTTP calls now apply to GovTalk submissions
- The progress dialog opens only when GuiAllowed; POST, text/xml, redirects and the 100s timeout are unchanged
- Two new HttpClientHandler tests cover a successful POST with XML parsing and a non-200 status returning false
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 10569 "GovTalk Message Management"](../../objects/codeunit/10569-gb.md), GovTalk (GB layer): modified
- [Codeunit 10520 "GovTalkMessageManagement"](../../objects/codeunit/10520-gb.md), Base Application (GB layer): modified

## Context

- Work items: AB#647963
- Labels: Team: Finance
- Systems: finance

## Possibly related

No source states these links: they share an object, a model read them, or a person found the same subject.

- [Call external services with the HttpClient data type](https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/devenv-httpclient) — possibly related: Explains how to use HttpClient data type for HTTP requests, directly relevant to migration from DotNet HttpWebRequest (model-linked)
- [Outgoing Web Service Request Trace](https://learn.microsoft.com/dynamics365/business-central/dev-itpro/administration/telemetry-webservices-outgoing-trace) — possibly related: Documents outgoing web service request telemetry for HTTP calls, applicable to GovTalk SendHttpRequest implementation (model-linked)

Source: metadata of a merged pull request in microsoft/BCApps (bcapps): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).
