question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Supporting HTTP client adapter

See original GitHub issue

Right now, the TypeScript generated code uses CoreHttp, which in turn seems to use either XmlHttpRequest or node-fetch, depending on what is available.

However, since I am using Appcelerator Titanium to build my app (which is a node-based language but still doesn’t support node’s http library and therefore doesn’t support node-fetch either), I am out of options to make the generated code work for my app.

In swaggergen (which I would like to switch away from), it is possible to define an “adapter”. A simple abstraction that (per default) wraps the CoreHttp client, but can be substituted out (dependency inversion principle, open/closed principle).

I think it would be easy to implement in Autorest, and it would allow the library to be used anywhere, while retaining backwards compatibility.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ramya-rao-acommented, Jun 8, 2021

Fair

I was focusing on the fact that moving to the new Azure Core libraries would remove the dependency on node-fetch and did not pay attention to rest of the issues like “node-based language but still doesn’t support node’s http library”

In swaggergen (which I would like to switch away from), it is possible to define an “adapter”. A simple abstraction that (per default) wraps the CoreHttp client, but can be substituted out (dependency inversion principle, open/closed principle).

Can you elaborate on this please?

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTTP Client Adapter - IBM
Supports HTTP 1.1. Business usage, Use this adapter to send documents to a trading partner using HTTP. Usage example, The Sterling B2B Integrator ......
Read more >
HTTP Client Connection Adapters - Zend Expressive
It supports secure connections, proxies, and multiple authentication mechanisms. In particular, it is very performant with regards to transfering large files.
Read more >
Retrofit Java 11 Http Client adapter - GitHub
An adapter between Retrofit and asynchronous non-blocking Java 11 Http Client. With Retrofit by default OkHttp client is used under the hood as...
Read more >
HTTP Client Input Adapter
The TIBCO StreamBase® HTTP Client adapter performs HTTP requests and emits the contents via the Data output port. The adapter has multiple samples, ......
Read more >
HTTP Client - Hexagon
Many adapters can be developed to use different technologies. Its main functionalities are: HTTP, HTTPS and HTTP/2 support; Mutual TLS; Body encoding/decoding ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found