Java – What is the SWT API?

Java has several desktop development APIs, including AWT, Swing, JavaFX, and others. However, there is an API called SWT that seems to offer even better graphics capabilities than JavaFX.

What is the SWT API? Is it recommended to use it? Why?

http – Does it need to be tested if there are security headers in response to the API in javascript code?

I've found in one of the client-side libraries that it checks to see if the answer contains all the following headers with appropriate values ​​(for security reasons):

'content-type', 'application/json'
'content-type', 'charset=utf-8'
'X-Content-Type-Options', 'nosniff'
'content-disposition', 'attachment'
'X-Frame-Options', 'DENY'

If a header does not exist, the library will throw an exception.

I can see no reason how this can improve security by checking client-side libraries.

Does anyone have any idea if this makes sense or does not make sense?

P.S. This is not about whether these headers should be set by the server.

P.P.S. I've found this out, because for some reason, even if the header is present, I can see in logs that sometimes this exception is thrown for them X-... Headlines. I do not really know why, but I suppose either remove proxies headers or some browsers will remove them for some reason in js do not return. I would be happy to hear why, when someone knows reason.

json rpc – rpc API can not be called from another computer on the same local network

rpc api can not be called from another machine on the same local network

There is a test node on my local network that I can call rpc api Only from the node's machine, not from my local machine.

I know rpcallowip is changed in the current version

http clinet httpie

IP of my local machine:

IP of the BTC node:

the harbor 8332 it is open.

$ bitcoind -version                 
# Bitcoin Core Daemon version v0.18.0.0-g2472733a24a9364e4c6233ccd04166a26a68cc65

I start testing and my IP is

bitcoind -regtest -deprecatedrpc=generate -printtoconsole -rpcuser=user -rpcpassword=password -rpcallowip= -rpcbind=  -server -rpcport=8332

customer request

# request from btc node's machine
http POST http://user:password@ jsonrpc="2.0" method="getblockchaininfo" id=1
# successed

# request from my local machine
http POST http://user:password@ jsonrpc="2.0" method="getblockchaininfo" id=1
# http: error: ConnectionError: HTTPConnectionPool(host='', port=8332): Max retries exceeded with url: / (Caused by NewConnectionError(': Failed to establish a new connection: (Errno 111) Connection refused',)) while doing POST request to URL: http://user:password@

What are design considerations as API developers / engineers when creating private and public APIs?

In my previous company, I created APIs that were primarily intended for (public) customers. At that time I was new to designing and joined after endpoints were already created, so I could not participate in the discussions.

Are there any differences in the considerations that normally consider developers / engineers / architects / companies / companies when creating private or public APIs? apart from the safety?

What's the difference between updating a product and batching a product in the Woocommerce Rest API?

According to the woocommerce documentation for updating products, we have two PUT and POST methods. With these methods, we can make massive updates to both updates and existing and new ones, provided we have a table with the data to perform these actions (update and rebuild)
When I use PUT

and the JSON would look like this:


"id": "794",
"sku": "hello1234",
"name": "premium_product"

That way, I can update a product individually. Suppose we need several at once. According to the woocommerce documents, we need to use POST like this:

What must the JSON structure be to use this method?

I thought I could use something like this:

  "update": {
      "id": "{id}",
      "stock_quantity": "{stock_quantity}"  

I'm stuck in it, every help is welcome. Thank you very much

Media – Upload user avatars using the rest API from Android to WordPress

I'm developing an Android app that lets users surf, sign up, sign up, post, and comment on my WordPress blog using Rest Api.

I'm now trying to add a way for users to update their avatars, but I have no idea how to upload media to my blog

add_action('rest_api_init', function () {

  register_rest_route( 'wp/v2', 'upload_image/',array(
                'methods'  => 'POST',
                'callback' => 'upload_image' )); });

function upload_image( $path ) {



Architecture – How do I call an unreliable API over the network? CompletableFutures vs. try catch block in Runnable Vs.

Any API that goes to a server is unreliable. For such an API, you'd expect to see an error either very soon after a call (usually due to a programming error), a correct response soon after the call, but occasionally with some delay, a similar-speed response or n indicating that no useful response is received, often with considerable delay. Whether your server times out or notifies that one of its servers has reported a time-out can usually be treated the same.

It is unusual for you to have to inform the server about an error. Think carefully if this is really necessary.

Then talk to the server developers about how the server will respond, if it crashes, restarts, or is under pressure and can not keep up with demands. You do not want to aggravate such a situation.

I would try to find a good strategy to repeat requests, cancel them, and possibly restart them based on a user request. Which technology you use is secondary.