Once we have assigned the API object to a variable describing our model, we send it to SkyCiv for analysis via the API. This is achieved by the use of a POST request. If you'd like to learn more about HTTP methods, w3schools.com provides a great definition.
There are various ways to contact the API:
- Using the packages developed by the SkyCiv team (highly recommended).
- Download the SkyCiv API file and include it in you project.
- Constructing the call manually.
You can view and learn about the available packages in the Packages section. We highly recommend this approach as we will continue to improve these packages to provide useful tools. This method is common industry practice as it helps keep your code clean and easy to read.
Although it may initially take longer to get setup, once you have an understanding of how package managers work (which we have provided) it will make future projects very quick and robust.
Alternatively, you can manually include the SkyCiv API file via GitHub in your project which will make the request for you (by calling the
request() function would be called as follows:
You can manually make a HTTP/HTTPS POST Request to either of the following endpoints depending on whether you wish to use HTTP or HTTPS:
The following links provide a live demonstration of how to achieve this across various languages. Just add your own credentials to the
Comments are provided to help you understand exactly what is happening. Notice that after removing the comments and print statements, the actual code is only a fraction of the file.
- Python 2 - Note: No longer supported by the Python Software Foundation, Python 3 is preferred.
- Python 3
The code located in the above links has also been provided below.