Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
20
Task/HTTP/Fortran/http.f
Normal file
20
Task/HTTP/Fortran/http.f
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
program simple_get
|
||||
use http, only : response_type, request
|
||||
implicit none
|
||||
type(response_type) :: response
|
||||
|
||||
! Send a GET request to retrieve JSON data
|
||||
response = request(url='https://jsonplaceholder.typicode.com/todos/1')
|
||||
|
||||
! Check if the request was successful
|
||||
if (.not. response%ok) then
|
||||
print *, 'Error message:', response%err_msg
|
||||
else
|
||||
! Print the response details
|
||||
print *, 'Response Code :', response%status_code
|
||||
print *, 'Response Length :', response%content_length
|
||||
print *, 'Response Method :', response%method
|
||||
print *, 'Response Content :', response%content
|
||||
end if
|
||||
|
||||
end program simple_get
|
||||
Loading…
Add table
Add a link
Reference in a new issue