Jump to content

Search the Community

Showing results for tags 'tnethttpclient'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Delphi-Version

Found 1 result

  1. B4Him

    TNetHttpClient

    Accessing APIs is new territory for me. I am trying to access an API using TNetHttpClient component. The curl example provided is: curl --request GET 'https://api.samsara.com/fleet/vehicles/stats' \ -d types='engineStates' \ -d decorations='gps' \ --header 'Authorization: Bearer TOKEN' \ -G I have been unsuccessful at using various settings of TNetHttpClient to get the authorization. I have the proper token but everything I try, I get the results "message":"invalid token" followed by the request id. My latest attempt is below but same results. Can anyone advice and perhaps provide sample code of how to accomplish this? Thank you in advance. var Params: TStringList; begin Params :=TStringList.Create; Params.Add('types = engineStates'); Params.Add('decorations=gps'); http1.CustHeaders.Add('Authorization', '<My Token>'); //<My Token replaced with actual token memo2.Lines.Text :=http1.Post('https://api.samsara.com/fleet/vehicles/stats', Params).ContentAsString; end;
×