How to Change Your Content Type for HTTP Post.vi or PUT.vi to JSON

Updated May 7, 2019

Reported In

Software

  • LabVIEW

Issue Details

I don't know how to change the POST.vi content type or other lines in the HTTP request. When I go to change the code internally, I see that the block diagram is password protected. 

Solution

Looking at the HTTP palette, there’s a folder dedicated to headers.
 

 
In this folder, there’s an Add Header VI. To change the Content-type to a JSON you can use the following syntax:
 



Here's another example of the full system for the PUT.vi: 

Additional Information

Content-type is a header in the HTTP request. You can find more information on HTTP request methods->POST.