[PR #487] [MERGED] Network Strategies #2650

Closed
opened 2026-03-17 00:20:02 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/487
Author: @AndrewBastin
Created: 1/14/2020
Status: Merged
Merged: 1/15/2020
Merged by: @AndrewBastin

Base: masterHead: refactor/network-strategy


📝 Commits (7)

  • 61d7dcf Added AxiosStrategy and ProxyStrategy Network Strategies
  • 3726f0a Added sendNetworkRequest to detect appropriate strategy and use it
  • 5ef1b5b Refactor index.vue to use Network Strategies
  • 3a8b433 Refactor graphql page to use Network Strategies
  • bd008f4 Refactor network and ProxyStrategy code
  • 1b783fd Merge branch 'master' into refactor/network-strategy
  • 061f86f 🐛 Fixed Nuxt loader won't finish after response

📊 Changes

5 files changed (+39 additions, -28 deletions)

View changed files

functions/network.js (+13 -0)
functions/strategies/AxiosStrategy.js (+9 -0)
functions/strategies/ProxyStrategy.js (+13 -0)
📝 pages/graphql.vue (+2 -15)
📝 pages/index.vue (+2 -13)

📄 Description

This PR intends to introduce Network Strategies into Postwoman.

Network Strategies are basically functions which take in the Postwoman Store and the request config and returns a Promise for the response. It generalizes the network request making process and makes further introduction of features easier.

Currently, this PR introduces 2 Network Strategies

  • AxiosStrategy : Uses axios to send the request
  • ProxyStrategy : Uses the postwoman proxy feature to send the request through a proxy.

Currently, Network Strategies allow its consumers to not worry about whether proxy is enabled, the sendNetworkRequest (found in functions/network.js) function will detect the appropriate strategy from the available and executes that. But in the future, when we plan to add new strategies (for e.g for native), we do not need to worry about rewriting the consumers to adopt those.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/487 **Author:** [@AndrewBastin](https://github.com/AndrewBastin) **Created:** 1/14/2020 **Status:** ✅ Merged **Merged:** 1/15/2020 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `master` ← **Head:** `refactor/network-strategy` --- ### 📝 Commits (7) - [`61d7dcf`](https://github.com/hoppscotch/hoppscotch/commit/61d7dcf61b2f98c3c06b5485525e746aab744b6a) Added AxiosStrategy and ProxyStrategy Network Strategies - [`3726f0a`](https://github.com/hoppscotch/hoppscotch/commit/3726f0a376c121c66115a65ce46d29aef39d0e05) Added sendNetworkRequest to detect appropriate strategy and use it - [`5ef1b5b`](https://github.com/hoppscotch/hoppscotch/commit/5ef1b5b75c2f6fe76c44eada1613ce623ba8e770) Refactor index.vue to use Network Strategies - [`3a8b433`](https://github.com/hoppscotch/hoppscotch/commit/3a8b4337f0309a167601a35462d81b851b5f7bba) Refactor graphql page to use Network Strategies - [`bd008f4`](https://github.com/hoppscotch/hoppscotch/commit/bd008f42dd358e5ce41d1720fee971d093bb9202) Refactor network and ProxyStrategy code - [`1b783fd`](https://github.com/hoppscotch/hoppscotch/commit/1b783fdfa050963ec2931958ce5d509b3ed5e231) Merge branch 'master' into refactor/network-strategy - [`061f86f`](https://github.com/hoppscotch/hoppscotch/commit/061f86fbfa3ee8a074c4e5270be0146507e92033) :bug: Fixed Nuxt loader won't finish after response ### 📊 Changes **5 files changed** (+39 additions, -28 deletions) <details> <summary>View changed files</summary> ➕ `functions/network.js` (+13 -0) ➕ `functions/strategies/AxiosStrategy.js` (+9 -0) ➕ `functions/strategies/ProxyStrategy.js` (+13 -0) 📝 `pages/graphql.vue` (+2 -15) 📝 `pages/index.vue` (+2 -13) </details> ### 📄 Description This PR intends to introduce Network Strategies into Postwoman. Network Strategies are basically functions which take in the Postwoman Store and the request config and returns a Promise for the response. It generalizes the network request making process and makes further introduction of features easier. Currently, this PR introduces 2 Network Strategies - **AxiosStrategy** : Uses axios to send the request - **ProxyStrategy** : Uses the postwoman proxy feature to send the request through a proxy. Currently, Network Strategies allow its consumers to not worry about whether proxy is enabled, the `sendNetworkRequest` (found in functions/network.js) function will detect the appropriate strategy from the available and executes that. But in the future, when we plan to add new strategies (for e.g for native), we do not need to worry about rewriting the consumers to adopt those. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 00:20:02 +03:00
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#2650
No description provided.