faustf Posted November 23, 2019 Share Posted November 23, 2019 hi guys , i would code a api in autoit , for portal octopart.com, https://octopart.com/api/docs/v3/search-tutorial but i have some questions , in curl i have this syntax $ curl -G http://octopart.com/api/v3/parts/search \ -d q=SN74S7* \ -d apikey=REPLACE_ME \ -d pretty_print=true but how can use inside the browser ? i tryed in this mode but answer me is not correct http://octopart.com/api/v3/parts/search&q=SN74S7&apikey=XXXXXXXXXXXXXXXXXXX __class__ "ClientErrorResponse" message "Missing required url argument: 'apikey'" and how is possible to do in autoit request ?? i try to do somthing like this but i am not sure if i am in a good way #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.5 Author: faustf Script Function: Octopart API #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here Global $sGQuery= "solid state relay" Func _SearchRequestAPI() Local $sLOctopartUrlBase ="http://octopart.com/api/v3" Local $sLoctopartUrlEndpoint = "/parts/search" Local $sLapiKey = "xxxxxxxxxxxxxxxx" EndFunc Func HttpGet($sURL, $sData = "") Local $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1") $oHTTP.Open("GET", $sURL & "?" & $sData, False) If (@error) Then Return SetError(1, 0, 0) $oHTTP.Send() If (@error) Then Return SetError(2, 0, 0) If ($oHTTP.Status <> $HTTP_STATUS_OK) Then Return SetError(3, 0, 0) Return SetError(0, 0, $oHTTP.ResponseText) EndFunc someone can help me thankz Link to comment Share on other sites More sharing options...
mikell Posted November 24, 2019 Share Posted November 24, 2019 On 11/23/2019 at 11:59 AM, faustf said: but how can use inside the browser ? Did you try something like this ? http://octopart.com/api/v3/parts/search?apikey=REPLACE_ME&q=SN74S7&pretty_print=true MarkIT 1 Link to comment Share on other sites More sharing options...
faustf Posted November 27, 2019 Author Share Posted November 27, 2019 thnak @mikell but return me __class__ "ClientErrorResponse" message "Forbidden request" Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now