Example Code

Converting a String to a URL

Code and Documents

Attachment

Download All

Overview:
This example shows how to convert any string to a URL that is safe for encoding HTTP requests. Only alphanumeric and certain special characters (such as () $-_.+!*') are legal in a URL.
Description:

The URL encoding requires that only alphanumerics [0-9 a-z A-Z], special characters [$-_.+!*'()], and "reserved" characters used for their normal purposes may be used unencoded within a URL. LabVIEW converts all other characters to %nn where nn is the decimal ASCII character number. You can convert spaces to + signs for HTTP get and HTTP post requests

Requirements:

  • LabVIEW 2012 (or compatible)

Steps to Implement or Execute Code:

  1. Type in the string that you want to convert in the "String" control.

  2. Set the boolean control per the comments on the front panel.

  3. Click the run arrow in the upper left-hand corner.

 Additional Information or References:Screenshot_3.png

 

 

"**This document has been updated to meet the current required format for the NI Code Exchange.**" 

 

 

Aashish M
CEO
TransferFi
www.transferfi.com

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
TCPlomp
Trusted Enthusiast
Trusted Enthusiast
on

There is also an Escape VI in the palettes (LabVIEW 2010 at least).

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!