{"id":18445630,"url":"https://github.com/fbarresi/beckhoffhttpclient","last_synced_at":"2025-04-08T00:31:39.195Z","repository":{"id":54770487,"uuid":"194646376","full_name":"fbarresi/BeckhoffHttpClient","owner":"fbarresi","description":"Unofficial TwinCAT function for HTTP-Client and Json conversion","archived":false,"fork":false,"pushed_at":"2022-09-18T12:46:14.000Z","size":363,"stargazers_count":66,"open_issues_count":5,"forks_count":9,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-23T03:06:45.119Z","etag":null,"topics":["api","beckhoff","json","rest","twincat","twincat-ads"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fbarresi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"fbarresi"}},"created_at":"2019-07-01T09:53:03.000Z","updated_at":"2025-01-09T15:28:00.000Z","dependencies_parsed_at":"2022-08-14T02:20:18.078Z","dependency_job_id":null,"html_url":"https://github.com/fbarresi/BeckhoffHttpClient","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbarresi%2FBeckhoffHttpClient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbarresi%2FBeckhoffHttpClient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbarresi%2FBeckhoffHttpClient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbarresi%2FBeckhoffHttpClient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fbarresi","download_url":"https://codeload.github.com/fbarresi/BeckhoffHttpClient/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247755338,"owners_count":20990616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","beckhoff","json","rest","twincat","twincat-ads"],"created_at":"2024-11-06T07:06:37.364Z","updated_at":"2025-04-08T00:31:38.562Z","avatar_url":"https://github.com/fbarresi.png","language":"C#","funding_links":["https://github.com/sponsors/fbarresi"],"categories":[],"sub_categories":[],"readme":"Beckhoff Http Client\n======\n[![Build status](https://ci.appveyor.com/api/projects/status/bhsi49foyc8tnve2?svg=true)](https://ci.appveyor.com/project/fbarresi/beckhoffhttpclient)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/ce95394710b143ae861a60d6fc938d8c)](https://www.codacy.com/manual/fbarresi/BeckhoffHttpClient?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=fbarresi/BeckhoffHttpClient\u0026amp;utm_campaign=Badge_Grade)\n![Licence](https://img.shields.io/github/license/fbarresi/Beckhoffhttpclient.svg)\n![GitHub All Releases](https://img.shields.io/github/downloads/fbarresi/BeckhoffHttpClient/total)\n\nUnofficial TwinCAT function for HTTP requests with json conversion\n\nThis open source library allow any beckhoff PLC (Windows CE based PLCs are not supported :disappointed_relieved: - see [this issue](https://github.com/fbarresi/BeckhoffHttpClient/issues/1#issuecomment-527231410)) to make API requests with an HTTP/HTTPS client.\nIf you are going to buy the [TF6760 | TC3 IoT HTTPS/REST](https://www.beckhoff.com.ph/default.asp?twincat/tf6760.htm) (planned for End 2019, not realized yet - Dec '19) you should first read this page and wonder how open-source software can simplify your life.\n\n## Key features\n\n- **NO Licence** costs (This software is free also for commercial uses)\n- support HTTP/HTTPS API calls\n- support **all** API methods (GET, POST, PUT, DELETE, HEAD, OPTIONS, PATCH, MERGE, COPY) \n- reads any Json body with complex nested structures (it also works with json lists of object as API response)\n- parse any Json response to plc structure\n\n## Prepare your PLC\n\n- Install the _unofficial_ TwinCAT Function [TFU001](https://github.com/fbarresi/BeckhoffHttpClient/releases/latest) on your target system\n- Install the TwinCAT Library to your project\n\n## How to use the TwinCAT Library\n\n### Reference the BeckhoffHttpClient Library\n\nDownload and reference the [BeckhoffHttpClient library](https://github.com/fbarresi/BeckhoffHttpClient/releases/latest) and import it to your project.\n\n![](https://github.com/fbarresi/BeckhoffHttpClient/raw/master/doc/images/BeckhoffHttpClientLibrary.png)\n\nYou can now declare and call a Client in your program and start using rest API.\n\n```\nPROGRAM MAIN\nVAR\n\tclient : HttpClient;\nEND_VAR\n```\n```\nclient(\n\tExecute:=FALSE , \n\tAddress:= 'https://dog.ceo/api/breeds/image/random', \n\tCallMethod:= 'GET' , \n\tBody:= '', \n\tResponseCode:= 'GVL.ResponseCode', \n\tResponse:= 'GVL.Response',  \n\tHasError=\u003e , \n\tErrorId=\u003e );\n```\n\n### The JSON Attribute\n\nThis software can parse and convert normal DUTs (also nested DUTs) into Json object thaks to the power of [TwinCAT.JsonExtension](https://github.com/fbarresi/TwinCAT.JsonExtension).\nThe only things you have to do is to add the JSON attribute to your code like follows and specify if your field has another json-name or can be used with its own name.\n\n```\nTYPE JsonDUT :\nSTRUCT\n\t{attribute 'json' := 'message'}\n\tsMessage : STRING;\n\tiResponse : INT;\n\t{attribute 'json' := 'status'}\n\tsStatus : STRING;\n\t{attribute 'json' := 'numbers'}\n\tdaNumbers : ARRAY[1..10] OF DINT := [1,2,3,4,5,6,7,8,9,10];\n\t{attribute 'json'}\n\tchild : ChildDUT;\nEND_STRUCT\nEND_TYPE\n```\n\n## Use an API header\n\nYou can setup an application-wide header using the `header.json` file placed into `C:\\TwinCAT\\Functions\\Unofficial\\BeckhoffHttpClient\\`.\n\nIf no header file is provided the application will create an example file `header_example.json` you can directly rename, edit and use.\n\n## Would you like to contribute?\n\nYes, please!\n\nTry the library and feel free to open an issue or ask for support. \n\nDon't forget to **star this project**! \n\n## Other projects\n\nCheck other project you may be interested in:\n\n- [BeckhoffS7Client](https://github.com/fbarresi/BeckhoffS7Client) S7 PLC communication library.\n- [TwinCatAdsTool](https://github.com/fbarresi/TwinCatAdsTool) Management tool for every TwinCat PLC\n\n## Credits\n\nSpecial thanks to [JetBrains](https://www.jetbrains.com/?from=BeckhoffHttpClient) for supporting this open source project.\n\n\u003ca href=\"https://www.jetbrains.com/?from=BeckhoffHttpClient\"\u003e\u003cimg height=\"200\" src=\"https://www.jetbrains.com/company/brand/img/jetbrains_logo.png\"\u003e\u003c/a\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffbarresi%2Fbeckhoffhttpclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffbarresi%2Fbeckhoffhttpclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffbarresi%2Fbeckhoffhttpclient/lists"}