RPC over HTTP does not work

#1
  1. My goal is: Call remote Json-RPC server
    hardware: ESP32-PICO-KIT
    mos version: 20190522-131204/2.14.0-g71e2991

  2. My actions are:
    RPC.call(“http://192.168.2.16/test.php”, ‘Config.Save’, {a: 1, b: 2}, function (resp, ud) {
    print(‘Response:’, JSON.stringify(resp));
    }, null);
    library list:

  1. The result I see is:
    [Jun 29 21:41:34.986] mg_rpc.c:225 Unsupported connection scheme in http://192.168.2.16/test.php

  2. My expectation & question is: Is it possible to use HTTP transport to make outgoing RPC call? My second question is: I have found a lot of links with examples, which used HTTP object from api_http.js But I have not found this library. So, is it possible to make POST/GET query from mjs?

#2

192.168.2.16 is a mOS device?

#3

no, it is workstation with nginx/php server

#4

api_http.js is part of the mjs library.

1 Like
#5

It looks like http outbound requests are not supported. Only ws/wss.