api design: REST methods that return dynamic data generated dynamically secure

Is a REST method that returns dynamically generated random data every time it is accessed safe?

According to RFC 2616 (emphasis mine):

In particular, the convention has been established that the GET and HEAD the methods SHOULD NOT have the meaning of performing an action other than recovery. These methods must be considered "safe". This allows user agents to represent other methods, such as POST, PUT and DELETE, in a special way, so that the user has knowledge of the fact that a possibly unsafe action is being requested.

Naturally, it is not possible to guarantee that the server does not generate side effects as a result of making a GET request; in fact, Some dynamic resources consider a feature. The important distinction here is that the user did not request the side effects, therefore, can not be held responsible for them.

My understanding of this is that the method must be considered safe since the only action is recovery. The state of the server does not change with several calls (although the result may be different) since any generated side effects would be the same (like the record that the endpoint was accessed).

I am not sure if this is the case, since you are not accessing a real resource since the data is generated dynamically. It could also be misinterpreting the concepts of secure methods, idempotency and how these concepts relate to the REST APIs. Any info is greatly appreciated!

Is it possible to divide a return flight into two one-way tickets?

My Indian friend was issued a six-month visa for visitors from the United Kingdom and booked a return trip (Delhi – Manchester) in November. I just booked a one-way ticket in July with another airline. Can you split your November reservation to use the return leg as proof of return for the July trip?

java – Return JSON Object of an API

I have an error when trying to return a json object resulting from previously entered data, follow the code:

try {
JsonObject json = new JsonObject ();

ArrayList params = new ArrayList ();
params.add (idProfissional);
params.add (idOoccupacao);

dbSpeciality db = new dbSpeciality (sqlHelper);
ResultSet rsSpecialty = db.getProfissionalUnity (params);

if (rsSpeciality! = null) {
while (rsEspecialidad.next ()) {

json.addProperty ("IdUnity", rsEspecialidad.getInt ("IdUnidad"));
json.addProperty ("name", rsSpeciality.getString ("unit"));
json.addProperty ("Endereco", rsEspecialidad.getString ("Endereco"));
json.addProperty ("Working Timetable", rsSpeciality.getString ("Working Timetable"));

}
} Else {

json.addProperty ("success", Boolean.FALSE);
json.addProperty ("msg", "No record found.");

}

return json.toString ();

} catch (Exception e) {
(in the event that this is not the case).
}

the return comes as follows:


        

HTTP Status 401 - Authorization Token not sent.

kind Report status

message Authorization token not sent.

description This request requires HTTP authentication.


Apache Tomcat / 8.0.15

Note: I do not have any authentication currently, it is in production phase.

8 – HTTP Client Manager $ request-> getStatusCode () == 200 return?

When I read this HTTP Client Manager documentation in Drupal, I do not understand why it returns $ build when $ request-> getStatusCode () == 200, is not it supposed to be equal to 200? I also copy and paste the Drupal document code.

public functions posts ($ limit, $ order) {
$ construct = [
      '#theme' => 'mymodule_posts_list',
      '#posts' => [],
];

$ request = $ this-> httpClient-> request (& # 39; GET & # 39 ;, & # 39; http: //api.example.com/posts&#39 ;, [
      'limit' => $limit,
      'sort' => $sort,
    ]);

// This is the part that I do not understand.
if ($ request-> getStatusCode () == 200) {
returns $ build;
}

$ posts = $ request-> getBody () -> getContents ();
foreach ($ posts like $ post) {
$ build['#posts'][]    = [
        'id' => $post['id'],
& # 39; title & # 39; => $ post['title'],
& # 39; text & # 39; => $ post['text'],
];
}
returns $ build;
}

Obtaining the return of my UK visa fee after 28 days

Can anyone help me with whom to contact regarding the refund of my canceled visa application fee? Today I did it for 28 days and I have not received the refund.

PowerShell – The return does not behave as expected

I am using PowerShell v5.1.
I have a question about "Return". Should not "Back" stop the execution of the script?

Get-CimInstance Win32_OperatingSystem | ForEach-Object {
"Go out"
He came back
}
"He does not"

ForEach ($ number in 1..2) {
"Go out"
He came back
}
"He does not"

The result is: Exit => No = = Exit

As you can see, "Return" behaves differently within the "ForEach-Object" loop and then inside the "ForEach" loop. What am I missing? Thank you ūüôā

def cat (f): f_name = open (f, r + w) for i in f_name: print (i) return;

How can I pass a text file in this function? I am using the Ubuntu operating system on AWS and I connect it with Jupyter-Notebook.
I tried loading a .txt file in my Jupyter notebook

xamarin.forms – Error: Count and Sum return zero values. / Xamarin – SQLite

I would like to ask about a problem I am having. It turns out that I'm doing an App in Xamarin with SQLite, but I have a problem that does not let me get ahead and I really have no idea why it happens.
I have two tables: "Customers" and "Orders", I need to bring two lists with the number of orders per customer and the sum of the amounts of those orders. For that work I use COUNT and SUM respectively and GROUP BY, but by bringing the list it brings me as results, pure zeros, the clients are correctly, but the quantity of orders and the sums are only zero (0).
It generates real curiosity because I have a twin database in SQL Server and that works great, but in the App it returns those values ‚Äč‚Äčto me.

In my tables:

[Table("Pedidos")]



public class Orders
{
    [PrimaryKey, AutoIncrement]
    public int Order_ID {get; set; }

    [ForeignKey(typeof(Clientes))]
    public int Customer_ID {get; set; }

    public DateTime Order_date {get; set; }
    public DateTime Date_Delivery {get; set; }
    public string Delivered {get; set; }
    public int Amount {get; set; }

    [ManyToMany(typeof(Pedidos_Productos))]
    public List Products {get; set; }
}

[Table("Clientes")]
public class Clients
{
    [PrimaryKey, AutoIncrement]
    public int Customer_ID {get; set; }

    [Unique]
    public string Name {get; set; }
    public string Telephone {get; set; }
    public string Address {get; set; }
    public string Locality {get; set; }
    public string Email {get; set; }
    public int Balance {get; set; }

    [ManyToMany(typeof(Clientes_Productos))]
    public List Products {get; set; }
}

I use this class to bring the lists:

public class Number of Orders
{
    public string Name {get; set; }
    public int requested number {get; set; }
}

Here the queries to the database:

                public List Bring OrderNumber ()
    {
        return Connection.Query("Select Clients.Name, count (Orders.Of_Order) as Orders from Orders, Clients where Clients.Client_id = Orders.Client_id group by Clients.Name"). ToList ();
    }

    public List BringSumPayments ()
    {
        return Connection.Query("select c.Name, sum (p.Monto) from Customers c, Orders p where c.Id_Client = p.Id_Client group by c.Name"). ToList ();
    }

Here I leave an image of the App at run time to see how it correctly returns the name of the client but the value is zero:

enter the description of the image here

I hope you can help me. Thank you so much

sqlite – The object array in javascript does not return as expected

I have a function that returns a list of objects in Javascript, and I'm calling this function from another and trying to use some of its values, but every time I try to access these values, they become undefined.

This is my function that generates the list; The idea is to create a sqlite3 database if it does not exist, and return an array that contains each event.

listAllEvents () {function
const sqlite3 = require (& # 39; sqlite3 & # 39;). verbose ();
const db = new sqlite3.Database (& # 39; schedule.db & # 39;);

const selectionArray = [];

db.serialize (() => {
db.run (`
CREATE TABLE IF THERE IS NOT ALL (
name of the text,
date text,
primary key of the identification text
)
`);

db.all (& # 39; SELECT * FROM all ORDER BY date & # 39 ;, [], (error, rows) => {
yes (err) {
throw away
}

rows.forEach ((row) => {
selectionArray.push (row);
});
});
});
return selectionArray;
}

I call this function from another, but when I try to access the values ‚Äč‚Äčin the matrix, they do not seem to be working and I can not understand it.

function displayUpcomingEvents () {
const events = listAllEvents ();

// console.log (events); <- This line here! In the console, it correctly indicates the length of the matrix
// console.log (events.length) <- This line, however, returns 0. Why?
// console.log (events[0]) <- This also does not work, it simply returns "undefined".

for (be i = 0; i <events.length; i + = 1) {
$ (& # 39; # upcomingEvents & # 39;). after (& # 39;
  • asdf
  • & # 39;); } }

    For example, if you had to create two events in the database, through the console,

    Events is an Array (2) with indexes.
    - 0: {name: "my_event", date: "2019-06-04", id: "c017c392d446d4b2"}
    - 1: {name: "my_event_2", date: "2019-06-04", id: "6d655ac8dd02e3fd"},
    
    events.length returns 0,
    and events[0] returns indefinite.
    

    Why is this, and what can I do to solve it?

    Do I need a passport to return from Canada?

    No, but under the Western Hemisphere Travel Initiative (WHTI) of the United States, the other documents you can use instead of a passport are quite limited:

    The citizens of the USA UU They can present a valid US passport. UU Passport card; Improved driver's license; Trusted Traveler program card (NEXUS, SENTRI or FAST); Military identification card of the USA UU When traveling with official orders US Merchant Mariner Document UU When traveling together with official maritime businesses; or Form I-872 American Indian Card, or (when available) Enhanced Tribal Card.

    (If you are under 16, or younger than 19 and traveling with a group of young people, the requirements are more flexible).

    Canada will admit you with proof of identification and citizenship, such as a driver's license and a US birth certificate. UU., Although they do not go out of their way to point out that it is possible to use documents that do not meet the requirements of the WHTI.

    If you travel to Canada with these documents, you can re-enter the US. UU Because the USA UU They can not deny re-entry to a US citizen. UU Simply because it lacks the proper documents. There is a fee in the works for people in that situation, but for now you can not expect anything more inconvenient than a delayed entry to the US. UU Along with a scolding by the border officer.

    The passport card is $ 30, and enhanced driver's licenses and state IDs also cost $ 30 more than their unimproved versions. If you do not want to disburse money from a passport, this would probably be your best option.