[GH-ISSUE #5772] [bug]: Missing User-Agent String in Generated Code #2254

Open
opened 2026-03-16 23:45:22 +03:00 by kerem · 3 comments
Owner

Originally created by @Grauenwolf on GitHub (Jan 14, 2026).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/5772

Originally assigned to: @swaraj017 on GitHub.

Is there an existing issue for this?

  • I have searched existing issues and this bug hasn't been reported yet

Platform

Web App

Browser

Chrome

Operating System

Windows

Bug Description

When Hoppscotch makes a web request via the browser, it includes a User-Agent header.

When using the "Show Code" feature, the User-Agent header isn't included when generating C# code.

This can cause the C# code to fail if the server is expecting a User-Agent header.

Suggestion

Have the code generator include the User-Agent header by default to avoid unexpected surprises.

Deployment Type

Hoppscotch Cloud

Version

No response

Originally created by @Grauenwolf on GitHub (Jan 14, 2026). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/5772 Originally assigned to: @swaraj017 on GitHub. ### Is there an existing issue for this? - [x] I have searched existing issues and this bug hasn't been reported yet ### Platform Web App ### Browser Chrome ### Operating System Windows ### Bug Description When Hoppscotch makes a web request via the browser, it includes a User-Agent header. When using the "Show Code" feature, the User-Agent header isn't included when generating C# code. This can cause the C# code to fail if the server is expecting a User-Agent header. ## Suggestion Have the code generator include the User-Agent header by default to avoid unexpected surprises. ### Deployment Type Hoppscotch Cloud ### Version _No response_
Author
Owner

@mohswell commented on GitHub (Jan 16, 2026):

Hi @Grauenwolf can i work on this?
Is this the header I should add value: "Hoppscotch Agent"

Have the code generator include the User-Agent header by default to avoid unexpected surprises.

<!-- gh-comment-id:3759958339 --> @mohswell commented on GitHub (Jan 16, 2026): Hi @Grauenwolf can i work on this? Is this the header I should add `value: "Hoppscotch Agent"` > Have the code generator include the User-Agent header by default to avoid unexpected surprises.
Author
Owner

@Grauenwolf commented on GitHub (Jan 16, 2026):

I don't know what is currently using so I can't advise. I ended up just stealing the user agent string from Powershell for my C# code.

<!-- gh-comment-id:3761199177 --> @Grauenwolf commented on GitHub (Jan 16, 2026): I don't know what is currently using so I can't advise. I ended up just stealing the user agent string from Powershell for my C# code.
Author
Owner

@swaraj017 commented on GitHub (Feb 11, 2026):

Hi @Grauenwolf

I’d like to take up this issue.

I will review the C# code generator to identify why the User-Agent header is not included and update the generation logic so that it correctly reflects the request headers.

Please let me know if I can proceed.

<!-- gh-comment-id:3884821457 --> @swaraj017 commented on GitHub (Feb 11, 2026): Hi @Grauenwolf I’d like to take up this issue. I will review the C# code generator to identify why the User-Agent header is not included and update the generation logic so that it correctly reflects the request headers. Please let me know if I can proceed.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#2254
No description provided.