Subject: | HTTP POST
| Date: | Fri, 27 Oct 2017 14:30:16 +0200
| From: | "modridirkac" <jure.zorko@gmail.com>
| Newsgroups: | pnews.paradox-programming
|
I need to send some data to web server with POST method.
I Only have information, that I should send "order_id" and "status".
I only get ""status_id missing!".
With CURL it works OK:
curl.exe -d "order_id=44&status=19" -k -X POST https://some web
store.com/index.php?route=order/manage/updateStatus
What else shoul I do to make my OPAL code POST work?
Thx Jure
----------------------
method run(var eventInfo Event)
var
oaXMLHTTP oleAuto
RequestURL string
result string
isOK logical
msgStr string
endvar
RequestURL = "https://www.some web
store.com/index.php?route=order/manage/updateStatus"
result = ""
isOK = false
msgStr = "<order_id>44</order_id>"
+ "<status_id>19</status_id>"
try
if oaXMLHTTP.open("Msxml2.XMLHTTP.3.0") then
oaXMLHTTP^open("POST",RequestURL, false)
oaXMLHTTP^setRequestHeader("Content-Type", "application/html\n")
oaXMLHTTP^send(msgStr)
result = oaXMLHTTP^responseText
isOK = true
endif
onFail
endTry
if not isOK then
errorShow()
return
endif
result.view("Returned")
endMethod
|