/
HTTP Multipart
HTTP Multipart
Receiving Http Multipart Request: Refer to the Hello World Example of Facet Instance for creation of http endpoint. Once an endpoint is generated it is capable of receiving Http Requests.
Http Multipart Request using Postman: Postman client can be used to create a HTTP multipart request and post it to our end point. The Image below shows how to create a multipart message using postman
do not specify any Headers in postman, the postman will automatically make the content type as multipart-form data
Http Multipart Format: The multipart request received by the end point will have the following format for headers and message value.
Headers
<Headers> <host>localhost:8080</host> <connection>keep-alive</connection> <content-length>2475</content-length> <cache-control>no-cache</cache-control> <origin>chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop</origin> <content-type>multipart/form-data; boundary=----WebKitFormBoundaryxRsh1y6qMB6roOP3</content-type> <user-agent>Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36</user-agent> <postman-token>26420381-ed86-bff9-c88d-7bb6f7a5c3eb</postman-token> <accept>*/*</accept> <accept-encoding>gzip, deflate</accept-encoding> <accept-language>en-US,en;q=0.8</accept-language> </Headers>
Message Value
<Message> <Value> <HttpFileUpload> <Tag>CSVFile</Tag> <FileName>ATGHistorian.csv</FileName> <FileContentType>text/csv</FileContentType> <FileContents>Tag Name,Address,Data Type,Respect Data Type,Client Access,Scan Rate,Scaling,Raw Low,Raw High,Scaled Low,Scaled High,Scaled Data Type,Clamp Low,Clamp High,Eng Units,Description,Negate Value "TankData.USSAV1S01HST.Tank1.Tank_1_Agitator_Motor_Running_Bit","K0005",Boolean,1,R/W,100,,,,,,,,,,"", "TankData.USSAV1S01HST.Tank1.Tank_1_FCU_Temperature","K0000",Float,1,R/W,100,Linear,0,1000,999,1000,Float,1,0,"","Temperature value for a tank",0 "TankData.USSAV1S01HST.Tank1.Tank_1_Gallon_Value","K0001",Float,1,R/W,100,Linear,0,1000,1.34547E+015,1.34547E+017,Double,0,0,"","Total capacity of a tank",0 "TankData.USSAV1S01HST.Tank1.Tank_1_Loading_PP_Motor_Running_Bit","K0004",Boolean,1,R/W,100,,,,,,,,,,"", "TankData.USSAV1S01HST.Tank1.Tank_1_RAW_Level_Inches","K0012",Float,1,R/W,100,Linear,0,1000,568,1000,Double,0,0,"","",0 "TankData.USSAV1S01HST.Tank1.Tank_1_steaming_in_auto_selected_HMI","K0003",Boolean,1,R/W,100,,,,,,,,,,"Bit indicating if steamer is on.", "TankData.USSAV1S01HST.Tank1.Tank_1_unld_PP_Motor_Running_Bit","K0002",Boolean,1,R/W,100,,,,,,,,,,"", "TankData.USSAV1S01HST.Tank2.Tank_2_Agitator_Motor_Running_Bit","K0006",Boolean,1,R/W,100,,,,,,,,,,"", "TankData.USSAV1S01HST.Tank2.Tank_2_FCU_Temperature","K0007",Float,1,R/W,100,Linear,0,1000,56,1000,Float,0,0,"","Temperature value for a tank",0 "TankData.USSAV1S01HST.Tank2.Tank_2_Gallon_Value","K0008",Float,1,R/W,100,Linear,0,1000,1.34547E+015,1.34547E+017,Double,0,0,"","Total capacity of a tank",0 "TankData.USSAV1S01HST.Tank2.Tank_2_Loading_PP_Motor_Running_Bit","K0009",Boolean,1,R/W,100,,,,,,,,,,"", "TankData.USSAV1S01HST.Tank2.Tank_2_RAW_Level_Inches","K0013",Float,1,R/W,100,Linear,0,1000,34.6,1000,Double,0,0,"","",0 "TankData.USSAV1S01HST.Tank2.Tank_2_steaming_in_auto_selected_HMI","K0010",Boolean,1,R/W,100,,,,,,,,,,"Bit indicating if steamer is on.", "TankData.USSAV1S01HST.Tank2.Tank_2_unld_PP_Motor_Running_Bit","K0011",Boolean,1,R/W,100,,,,,,,,,,"", </FileContents> </HttpFileUpload> <HttpFileUpload> <Tag>TestFile</Tag> <FileName>Test.txt</FileName> <FileContentType>text/plain</FileContentType> <FileContents>lkdfjls;kjfs;ldkjf;lskdjf;lskdjf;lsdkjfl;skdjfl;sdkjfl;skdjf s;ldkfj;ldskjf;lskdjf;lskj;ldkj </FileContents> </HttpFileUpload> <HttpAttribute> <AttributeName>MyName</AttributeName> <AttributeValue>Baseer</AttributeValue> </HttpAttribute> </Value> </Message>
, multiple selections available,
Related content
HTTP handler (http://)
HTTP handler (http://)
More like this
Facet Instance
Facet Instance
More like this
FacetScript Language
FacetScript Language
More like this
Websocket (pws://)
Websocket (pws://)
More like this
Persistent HTTP (phttp://)
Persistent HTTP (phttp://)
More like this
Facet Types
Facet Types
More like this