Assembly: Net;
The INetHttpService interface contains properties and methods that are used to work with network resources via HTTP/HTTPS protocol.
INetHttpService
The interface can be used to connect and work with various web servers and services via HTTP/HTTPS protocol using SOAP requests. To create a connection to network resources, follow the steps:
Create an instance of the NetHttpService class.
Set URL of network resource for the obtained object in the INetHttpService.Url property.
Execute the INetService.Connect method for connection. The method results in the context to work with network resource using requests. To determine additional settings, cast the obtained context to the INetHttpCommand interface.
Specify GET requests in resource URL that is set in the INetHttpService.Url property.
When executing a POST request, specify necessary data/request to be sent in the body of POST request in the INetCommand.Start parameter. Requests are specified in the SOAP format by default. If JSON requests are assumed to be executed, add the Content-Type: application/json;charset=utf-8 header to the INetHttpCommand.Headers collection and set the INetHttpCommand.OuterBody property to True.
If services are available via the HTTPS protocol, use security certificate in the PEM format:
In Linux OS execute one of the operations:
Add certificate contents to the /etc/ssl/certs/ca-certificates.crt file in Debian-based distributions and to the /etc/pki/tls/certs/ca-bundle.crt file in RedHat-based distributions and in ALT Linux.
The certificate with the *.pem extension to the /etc/ssl/certs folder in Debian-based distributions and to the /etc/pki/tls/certs folder in RedHat-based distributions and in ALT Linux.
In Windows OS:
Start the Microsoft Management Console built-in utility.
Add the certificate to the Trusted Root Certification Authorities > Certificates folder.
| Property name | Brief description | |
![]() |
Url | The Url property determines URL of network resource. |
| Method name | Brief description | |
![]() |
Connect | The Connect method connects to the network resource and returns context to communicate with it. |
See also: