You are here: Start » AVL.NET » Function Reference » System » HTTP » AVL.Http_SendRequest_POST

AVL.Http_SendRequest_POST

Sends a POST request to the server and receives a text answer.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax

C++
C#
 
public static void Http_SendRequest_POST
(
	string inUrl,
	IList<string> inFields,
	IList<string> inFieldsData,
	INullable<string> outAnswer,
	out int outResponseCode
)

Parameters

Name Type Range Default Description
inUrlstringURL of request.
inFieldsSystem.Collections.Generic.IList<string>Request data to send. It will be automatically encoded.
inFieldsDataSystem.Collections.Generic.IList<string>Request data to send. It will be automatically encoded.
outAnswerAvlNet.INullable<string>Answer text if provided in UTF-8 encoding. This parameter cannot be null.
outResponseCodeintAnswer code. Typically 200 for OK.

Description

Filter sends a POST request to the server using application/x-www-form-urlencoded format. Filter waits for the sever text answer.

Examples

Filter executed with parameters:

  • inUrl = http://localhost/test
  • inFields = ["param1", "param2"]
  • inFieldsData = ["1", "2"]

Request sent to the server:

POST /test HTTP/1.1
Host: localhost
User-Agent: Adaptive Vision/1.0
Accept: */*
Content-Length: 17
Content-Type: application/x-www-form-urlencoded

param1=1&param2=2

Remarks

Filter only accepts text answers encoded using UTF-8 or plain ASCII. To receive answer in arbitrary format please use Http_SendRequest_POST_ByteBuffer.

Errors

List of possible exceptions:

Error type Description
DomainError Different size of inFields and inFieldsData in Http_SendRequest_POST.
DomainError Empty inUrl in Http_SendRequest_POST.
DomainError Invalid inUrl in Http_SendRequest_POST.
DomainError Secured HTTPS connection is not supported in Http_SendRequest_POST.

See also