---
title: "HTTP methods"
canonical: "https://docs.cuesystem.com/space/CVCHELP/555090020/HTTP%20methods"
format: markdown
---
> ℹ️ For creating drivers, it is recommended to use [https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/520486913](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/520486913).

> Macro (toc)

---

# EncodeURIComponent

This function encodes the URI component.  

#### Syntax 

```visualbasic
Function EncodeURIComponent( 
  uricomponent As Text, 
  ByRef encodedcomponent As Text) 
As Boolean
```

#### Parameters 

uricomponent 

<u>[Text](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Text)</u> . It is the source URI component. 

encodedcomponent 

<u>[Text](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Text)</u> . It is the destination buffer for the encoded URI component. 

#### Return value 

<u>[Boolean](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> It is True on success or False if an error occurs. 

The function GetLastError returns the error number. These errors can happen: <u>[279](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/510525445/Command+errors#279)</u>[ ](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/510525445)

# HTTPGet

This function is a simple way how to get a reply from the web server by HTTP protocol. Command supports only the HTTP GET method. Command supports cookies, basic authentication, and HTTP redirection. Digest authentication is supported since firmware version 14. 

> ⚠️ This command is obsolete. For new projects, it is recommended to use [https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/520486913](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/520486913). This command will be supported in future versions, but there are no plans to enhance it.

> ℹ️ Only one HTTPGet command can be executed at a time in a single unit. If an HTTPGet command is executed from another process while another HTTPGet command is already in progress, the system will wait until the first HTTPGet command is complete.

> ℹ️ The timeout for connecting to the HTTP server is 20 seconds. The timeout for waiting for a reply from HTTP server is 30 seconds.


#### Syntax 

```
Function HTTPGet(
  encodedURL As ByteString, 
  ByRef reply As ByteString, 
  Optional username As ByteString := &S"", 
  Optional password As ByteString := &S"") 
As Boolean
```

#### Parameters 

encodedURL 

<u>[ByteString](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#ByteString)</u> URL. It must be in the followed format: [scheme://][username:password@]servername[:port][path][?query] 

HTTP and HTTPS are supported schemes. If no scheme is specified, HTTP is selected. If no port is specified, it is selected by the scheme automatically (for the HTTP scheme is default port 80, and the HTTPS scheme is default port 443). Path and query part in URL must be encoded if it is necessary. 

reply 

<u>[ByteString](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#ByteString)</u>. It is received an answer from a web server 

username 

<u>[ByteString](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#ByteString)</u>. User name. If a username is specified, any username or password entered in the URL will not be used. 

password 

<u>[ByteString](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#ByteString)</u>. Password. If a password is specified, any username or password entered in the URL will not be used. 

#### Return value 

<u>[Boolean](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u>. It is True on success or False if an error occurs. 

A function GetLastError returns the error number. These errors can happen: <u>[88](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/510525445/Command+errors#88)</u><u>,</u> <u>[92](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/510525445/Command+errors#92)</u>, <u>[94](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/510525445/Command+errors#94)</u>, <u>[234](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/510525445/Command+errors#234)</u>, <u>[241](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/510525445/Command+errors#241)</u>, <u>[278](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/510525445/Command+errors#278)</u>, <u>[283](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/510525445/Command+errors#283)</u>, <u>[284](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/510525445/Command+errors#284)</u>, <u>[286](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/510525445/Command+errors#286)</u>