@@ -22,7 +22,7 @@ The following icons indicate API compatibility when running in background trigge
2222- [ storage] ( #storage ) ✅ - Local key-value storage
2323- [ icloud] ( #icloud ) ✅ - iCloud file operations
2424- [ file] ( #file ) ✅ - File system operations
25- - [ http] ( #http ) ✅ - Network requests
25+ - [ http] ( #http ) ✅ - Network requests (Async Promise-based)
2626- [ network] ( #network ) ⚠️ - Network operations
2727- [ app] ( #app ) ⚠️ - App operations and management
2828- [ haptic] ( #haptic ) ⚠️ - Haptic feedback
@@ -796,146 +796,158 @@ Check if the Root Helper is available
796796
797797![ Full Support] ( https://img.shields.io/badge/Trigger-Full-brightgreen )
798798
799- Network requests
799+ Network requests (Async Promise-based)
800800
801801### ` http.get `
802802
803803** Signature:** ` get(url, options?) `
804804
805- Send a GET request
805+ Send a GET request (async, returns Promise)
806806
807807** Parameters:**
808808
809809| Name | Type | Description | Optional |
810810| ------| ------| -------------| ----------|
811811| ` url ` | ` string ` | Target URL | No |
812- | ` options ` | ` object ` | Request options { headers, timeout } | Yes |
812+ | ` options ` | ` object ` | Request options { headers, timeout, insecure, sync } | Yes |
813813
814- ** Returns:** ` { success: boolean, status?: number, data?: string, headers?: object, error?: string } `
814+ ** Returns:** ` Promise< { success: boolean, status?: number, data?: string, headers?: object, error?: string }> `
815815
816- * Object containing success status, status code, response data, and response headers*
816+ * Returns a Promise that resolves with success status, status code, response data, and headers. Set sync: true for synchronous mode *
817817
818818---
819819
820820### ` http.post `
821821
822822** Signature:** ` post(url, options?) `
823823
824- Send a POST request
824+ Send a POST request (async, returns Promise)
825825
826826** Parameters:**
827827
828828| Name | Type | Description | Optional |
829829| ------| ------| -------------| ----------|
830830| ` url ` | ` string ` | Target URL | No |
831- | ` options ` | ` object ` | Request options { body, headers, timeout, insecure } | Yes |
831+ | ` options ` | ` object ` | Request options { body, headers, timeout, insecure, sync } | Yes |
832832
833- ** Returns:** ` { success: boolean, status?: number, data?: string, headers?: object, error?: string } `
833+ ** Returns:** ` Promise<{ success: boolean, status?: number, data?: string, headers?: object, error?: string }> `
834+
835+ * Returns a Promise that resolves with the response. Set sync: true for synchronous mode*
834836
835837---
836838
837839### ` http.put `
838840
839841** Signature:** ` put(url, options?) `
840842
841- Send a PUT request
843+ Send a PUT request (async, returns Promise)
842844
843845** Parameters:**
844846
845847| Name | Type | Description | Optional |
846848| ------| ------| -------------| ----------|
847849| ` url ` | ` string ` | Target URL | No |
848- | ` options ` | ` object ` | Request options { body, headers, timeout, insecure } | Yes |
850+ | ` options ` | ` object ` | Request options { body, headers, timeout, insecure, sync } | Yes |
851+
852+ ** Returns:** ` Promise<{ success: boolean, status?: number, data?: string, headers?: object, error?: string }> `
849853
850- ** Returns: ** ` { success: boolean, status?: number, data?: string, headers?: object, error?: string } `
854+ * Returns a Promise that resolves with the response *
851855
852856---
853857
854858### ` http.delete `
855859
856860** Signature:** ` delete(url, options?) `
857861
858- Send a DELETE request
862+ Send a DELETE request (async, returns Promise)
859863
860864** Parameters:**
861865
862866| Name | Type | Description | Optional |
863867| ------| ------| -------------| ----------|
864868| ` url ` | ` string ` | Target URL | No |
865- | ` options ` | ` object ` | Request options { headers, timeout, insecure } | Yes |
869+ | ` options ` | ` object ` | Request options { headers, timeout, insecure, sync } | Yes |
870+
871+ ** Returns:** ` Promise<{ success: boolean, status?: number, data?: string, headers?: object, error?: string }> `
866872
867- ** Returns: ** ` { success: boolean, status?: number, data?: string, headers?: object, error?: string } `
873+ * Returns a Promise that resolves with the response *
868874
869875---
870876
871877### ` http.patch `
872878
873879** Signature:** ` patch(url, options?) `
874880
875- Send a PATCH request
881+ Send a PATCH request (async, returns Promise)
876882
877883** Parameters:**
878884
879885| Name | Type | Description | Optional |
880886| ------| ------| -------------| ----------|
881887| ` url ` | ` string ` | Target URL | No |
882- | ` options ` | ` object ` | Request options { body, headers, timeout, insecure } | Yes |
888+ | ` options ` | ` object ` | Request options { body, headers, timeout, insecure, sync } | Yes |
883889
884- ** Returns:** ` { success: boolean, status?: number, data?: string, headers?: object, error?: string } `
890+ ** Returns:** ` Promise<{ success: boolean, status?: number, data?: string, headers?: object, error?: string }> `
891+
892+ * Returns a Promise that resolves with the response*
885893
886894---
887895
888896### ` http.head `
889897
890898** Signature:** ` head(url, options?) `
891899
892- Send a HEAD request
900+ Send a HEAD request (async, returns Promise)
893901
894902** Parameters:**
895903
896904| Name | Type | Description | Optional |
897905| ------| ------| -------------| ----------|
898906| ` url ` | ` string ` | Target URL | No |
899- | ` options ` | ` object ` | Request options { headers, timeout, insecure } | Yes |
907+ | ` options ` | ` object ` | Request options { headers, timeout, insecure, sync } | Yes |
908+
909+ ** Returns:** ` Promise<{ success: boolean, status?: number, data?: string, headers?: object, error?: string }> `
900910
901- ** Returns: ** ` { success: boolean, status?: number, data?: string, headers?: object, error?: string } `
911+ * Returns a Promise that resolves with the response ( data is typically empty for HEAD requests) *
902912
903913---
904914
905915### ` http.request `
906916
907917** Signature:** ` request(url, options) `
908918
909- Send a custom HTTP request
919+ Send a custom HTTP request (async, returns Promise)
910920
911921** Parameters:**
912922
913923| Name | Type | Description | Optional |
914924| ------| ------| -------------| ----------|
915925| ` url ` | ` string ` | Target URL | No |
916- | ` options ` | ` object ` | Request options { method, body, headers, timeout, insecure } | No |
926+ | ` options ` | ` object ` | Request options { method, body, headers, timeout, insecure, sync } | No |
917927
918- ** Returns:** ` { success: boolean, status?: number, data?: string, headers?: object, error?: string } `
928+ ** Returns:** ` Promise<{ success: boolean, status?: number, data?: string, headers?: object, error?: string }> `
929+
930+ * Returns a Promise that resolves with the response*
919931
920932---
921933
922934### ` http.download `
923935
924936** Signature:** ` download(url, path, options?) `
925937
926- Download a file from a URL
938+ Download a file (async, returns Promise)
927939
928940** Parameters:**
929941
930942| Name | Type | Description | Optional |
931943| ------| ------| -------------| ----------|
932944| ` url ` | ` string ` | Download source URL | No |
933945| ` path ` | ` string ` | Local destination path to save the file | No |
934- | ` options ` | ` object ` | Request options { insecure } | Yes |
946+ | ` options ` | ` object ` | Request options { insecure, sync } | Yes |
935947
936- ** Returns:** ` { success: boolean, path?: string, error?: string } `
948+ ** Returns:** ` Promise< { success: boolean, path?: string, error?: string }> `
937949
938- * Object containing success status and the local file path*
950+ * Returns a Promise that resolves with success status and local file path*
939951
940952---
941953
0 commit comments