Friends, I can't understand what's going on, I'm new to programming.
#Create Employee
@manter_user = Crud.new (my class)
#Create
$response = @manter_user.create(my method)
puts "Response is: #{$response}"
puts "Create Response HTTP code 200: #{$response.code == 200}"
end
crete ok
Response is: {"status":"success","data":{"name":"Kip","salary":8037.4700000000002546585164964199066162109375,"age":63,"id":7435},"message":"Successfully! Record has been added."}
**Create Response HTTP code 200: true**
#list
@id = $response.parsed_response["data"]["id"]
puts "@id: #{@id} retornado é o mesmo préviamente criado..."
retrieve_response = @manter_user.retrieve(@id)
puts "Retrieve Response HTTP code 200: #{retrieve_response.code == 200}"
end
List
**Retrieve Response HTTP code 200: false**
As I mentioned in my previous Answer and the comments below.
The dummy API you are using does not actually store the records you are creating it just provides a dummy response.
Methods provided by the API:
There is no way using this dummy API that you can actually test the full lifecycle of record due to the way it is constructed.
Additionally it appears this API is in the process of being torn down: