Jump to content

Request UDF - The simplest way to make HTTP request


Ward
 Share

Recommended Posts

I want to implement curl like that. How can i put a header to curl :(.

for what I've seen at https://www.youtube.com/watch?v=VQv9xfOfLOY&index=1&list=PLoN_ejT35AEhbFswEKW36LxzyXJs7xCWS&ab_channel=MitchellHudson going all JavaScript may be the solution for Parse if you use https://parse.com/docs/js/api/ 
The OO_JSON.UDF has code you can use to base your code on. You may even make an AutoIt UDF, for the rest of us clueless guys ;)  

My 2 cents.

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

  • 1 month later...
  • 6 months later...

Hi, Can anyone help me please?

I'm trying to build a function to make a REST request and get a callback response using autoit.

Thank you very much.

Justin

This my REST Request url:

http://localhost/Sale

this is the json request value pairs      {"Amount":$0.99, "Orderid": "001"}

my REST callback url:

http://localhost/Callback/SaleResponse

this the callback response values     {"Success": [true|false], "Result": [SUCCESS|FAIL|CANCEL]}

Func My_Sale($Total, $Oid)
    RequestDefault('{refer: "http://localhost", agent: "autoit/Request", callback: "MyCallback"}')

    Local $Data =  Request("http://localhost/Sale", '{Amount: $Total, Orderid: $Oid}')
  ;ConsoleWrite($Data & @LF)

EndFunc


Func MyCallback($Obj)
    Local $Data = Json_ObjGet($Obj, "Data")
    Local $EffectiveUrl = Json_ObjGet($Obj, "http://localhost/Callback/SaleResponse")
     ;Need to get callback result checked.  
EndFunc

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...