Questions tagged [protocols]

A common means for (un)related objects to communicate with each other.

5592 questions
1345
votes
14 answers

SOAP vs REST (differences)

I have read articles about the differences between SOAP and REST as a web service communication protocol, but I think that the biggest advantages for REST over SOAP are: REST is more dynamic, no need to create and update UDDI(Universal…
Abdulaziz
  • 13,694
  • 3
  • 13
  • 12
398
votes
19 answers

Get protocol, domain, and port from URL

I need to extract the full protocol, domain, and port from a given URL. For example: https://localhost:8181/ContactUs-1.0/contact?lang=it&report_type=consumer >>> https://localhost:8181
yelo3
  • 5,613
  • 5
  • 26
  • 23
239
votes
8 answers

How do I create my own URL protocol? (e.g. so://...)

I have seen: http://www... ftp://blah.blah... file://blah.blah... unreal://blah.blah... mailto://blah.blah... What is that first section where you see http and the like called? Can I register my own?
Michael Beck
  • 2,806
  • 3
  • 20
  • 22
207
votes
3 answers

Difference between Pragma and Cache-Control headers?

I read about Pragma header on Wikipedia which says: "The Pragma: no-cache header field is an HTTP/1.0 header intended for use in requests. It is a means for the browser to tell the server and any intermediate caches that it wants a fresh…
saplingPro
  • 20,769
  • 53
  • 137
  • 195
164
votes
10 answers

How to check if a website has HTTP/2 protocol support

There are a lot of topics about the HTTP/2 protocol, but I wonder if there is a working website with this protocol. I.e. We can decide to use http:// or https://, but how can we write a HTTP/2 request? I am aware that this protocol depends on the…
Stevan Tosic
  • 6,561
  • 10
  • 55
  • 110
158
votes
13 answers

Difference between TCP and UDP?

What is the difference between TCP and UDP? I know that TCP is used in the case of non-time critical applications, and UDP is used for games or applications that require fast transmission of data. I know that TCP is used for HTTP, HTTPs, FTP, SMTP,…
user749414
  • 1,597
  • 2
  • 10
  • 4
150
votes
2 answers

Simple explanation of clojure protocols

I'm trying to understand clojure protocols and what problem they are supposed to solve. Does anyone have a clear explanation of the whats and whys of clojure protocols?
yazz.com
  • 57,320
  • 66
  • 234
  • 385
148
votes
6 answers

How do I register a custom URL protocol in Windows?

How do I register a custom protocol with Windows so that when clicking a link in an email or on a web page my application is opened and the parameters from the URL are passed to it?
lukeck
  • 4,528
  • 3
  • 27
  • 29
125
votes
8 answers

binary protocols v. text protocols

does anyone have a good definition for what a binary protocol is? and what is a text protocol actually? how do these compare to each other in terms of bits sent on the wire? here's what wikipedia says about binary protocols: A binary protocol is a…
der_grosse
  • 1,261
  • 2
  • 9
  • 4
111
votes
4 answers

DHT in torrents

I'm coding a P2P implementation that I would like to make decentralized. However I'm having some trouble grasping how DHT in protocols like BitTorrent works. How does the client know where the peers are if there is no tracker? Are peers stored in…
Christopher Tarquini
  • 11,176
  • 16
  • 55
  • 73
107
votes
2 answers

Cast an instance of a class to a @protocol in Objective-C

I have an object (a UIViewController) which may or may not conform to a protocol I've defined. I know I can determine if the object conforms to the protocol, then safely call the method: if([self.myViewController…
Ford
  • 1,485
  • 3
  • 14
  • 20
101
votes
10 answers

How to pass one SwiftUI View as a variable to another View struct

I'm implementing a very custom NavigationLink called MenuItem and would like to reuse it across the project. It's a struct that conforms to View and implements var body : some View which contains a NavigationLink. I need to somehow store the view…
Alex
  • 1,023
  • 2
  • 7
  • 9
101
votes
5 answers

Swift protocol error: 'weak' cannot be applied to non-class type

What's the difference between Protocols and class-bound Protocols, and which one we should use in Swift? protocol A : class { ... } protocol A { ... } We get an error when attempting to add a weak delegate when the Protocol is not defined as :…
boog
  • 1,813
  • 3
  • 18
  • 21
100
votes
4 answers

How to require that a protocol can only be adopted by a specific class

I want this protocol: protocol AddsMoreCommands { /* ... */ } only to be adopted by classes that inherit from the class UIViewController. This page tells me I can specify that it is only adopted by a class (as opposed to a struct) by…
emrys57
  • 6,679
  • 3
  • 39
  • 49
96
votes
3 answers

What is the difference between DTR/DSR and RTS/CTS flow control?

What's the difference between DTR/DSR and RTS/CTS hardware flow control? When is each one used? Why do we need more than one kind of hardware flow control? :)
Gili
  • 86,244
  • 97
  • 390
  • 689
1
2 3
99 100