Curl to ASP
Budget: $10 – $20 USD
Finalize the script that aims to transfer from Curl to ASP;
Time: 30~60 minutes
Script Curl:
curl --request POST \
--url https://api.website.com/post \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cC' \
--header 'Content-Type: application/json' \
--data-raw '{
"value": 10,
"account": "076812",
"type": "2",
"token": "XPTO"
}'
Script em develop in ASP:
<%
Dim strUrl = "https://api.website.com/post"
Dim strBearer = "Bearer eyJhbGciOiJIUzI1NiIsInR5cC"
Dim strAccount = "account"
Dim strType = "2"
Dim strToken = "CPTO"
Dim strDataRaw = "value=" & strURL & "," & "account=" & strAccount & "," & "type=" & strType & "," & "token=" & strToken & "," &
dim http
set http=CreateObject("MSXML2.ServerXMLHTTP")
http.open "POST",strURL,false
http.setRequestHeader "Content-Type","application/json"
http.setRequestHeader "Authorization",strBearer
http.send strDataRaw
%>
Return error:
{"error":{"name":"VALIDATION ERROR","message":"Validation Errors","frames":["The JSON value could not be converted to Api.WithdrawRequestDTO. Path: $ | LineNumber: 0 | BytePositionInLine: 1."]}}
Time: 30~60 minutes
Script Curl:
curl --request POST \
--url https://api.website.com/post \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cC' \
--header 'Content-Type: application/json' \
--data-raw '{
"value": 10,
"account": "076812",
"type": "2",
"token": "XPTO"
}'
Script em develop in ASP:
<%
Dim strUrl = "https://api.website.com/post"
Dim strBearer = "Bearer eyJhbGciOiJIUzI1NiIsInR5cC"
Dim strAccount = "account"
Dim strType = "2"
Dim strToken = "CPTO"
Dim strDataRaw = "value=" & strURL & "," & "account=" & strAccount & "," & "type=" & strType & "," & "token=" & strToken & "," &
dim http
set http=CreateObject("MSXML2.ServerXMLHTTP")
http.open "POST",strURL,false
http.setRequestHeader "Content-Type","application/json"
http.setRequestHeader "Authorization",strBearer
http.send strDataRaw
%>
Return error:
{"error":{"name":"VALIDATION ERROR","message":"Validation Errors","frames":["The JSON value could not be converted to Api.WithdrawRequestDTO. Path: $ | LineNumber: 0 | BytePositionInLine: 1."]}}