Hi everyone, I am trying to figure out how to get stuff from Postman (API tool) to work in Alpha v12
I can use the cURL genie that alpha has as a tool but it generates a hot mess. I have been down this road before and usually figure out what is wrong with the genie code and make it work.
Postman offers several versions of language such as
C- libcurl
c# - RestSharp
cURL
Go - Native
HTTP
Java -OkHttp
Java - Unirest
JavaScript - Fetch
JavaScript - jQuery
and several others, I would imagine that out of these the jQuery part would be the choice to easily adapt.
Here is the code in jQuery that worked in Postman but how do i get it to be in a function that I can fire with alpha.
I can use the cURL genie that alpha has as a tool but it generates a hot mess. I have been down this road before and usually figure out what is wrong with the genie code and make it work.
Postman offers several versions of language such as
C- libcurl
c# - RestSharp
cURL
Go - Native
HTTP
Java -OkHttp
Java - Unirest
JavaScript - Fetch
JavaScript - jQuery
and several others, I would imagine that out of these the jQuery part would be the choice to easily adapt.
Here is the code in jQuery that worked in Postman but how do i get it to be in a function that I can fire with alpha.
Code:
var settings = { "url": "https://api.oemserver.com/v1.0/paramtemplate/set/3063", "method": "POST", "timeout": 0, "headers": { "Content-Type": "application/json", "Authorization": "Basic Y2hhYGJyb3duQGNhbndpcmVsYXNzLmNhOm9lbTEyMw==", "User-Agent": "PostmanRuntime/7.22.0", "Accept": "*/*", "Cache-Control": "no-cache", "Postman-Token": "ad58cd69-c228-4529-85b4-682fa4e736dc", "Host": "api.oemserver.com", "Accept-Encoding": "gzip, deflate, br", "Content-Length": "42", "Connection": "keep-alive" }, "data": JSON.stringify({"Devices":[255483]}), }; $.ajax(settings).done(function (response) { console.log(response); });
Comment