Skip to content

Commit

Permalink
Merge pull request #268 from richardgroves/patch-1
Browse files Browse the repository at this point in the history
Replacing connectionWithURL: with connectionWithURLString:
  • Loading branch information
abillingsley authored Jun 21, 2016
2 parents 7724e82 + cc20dfe commit b160ee4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public class MyConnection : PersistentConnection
#import "SignalR.h"

//Client
SRConnection *connection = [SRConnection connectionWithURL:@"http://localhost/mysite/echo"];
SRConnection *connection = [SRConnection connectionWithURLString:@"http://localhost/mysite/echo"];

// Register for connection lifecycle events
[connection setStarted:^{
Expand Down Expand Up @@ -131,7 +131,7 @@ public class Chat : Hub
#import "SignalR.h"

// Connect to the service
SRHubConnection *hubConnection = [SRHubConnection connectionWithURL:@"http://localhost/mysite"];
SRHubConnection *hubConnection = [SRHubConnection connectionWithURLString:@"http://localhost/mysite"];
// Create a proxy to the chat service
SRHubProxy *chat = [hubConnection createHubProxy:@"chat"];
[chat on:@"addMessage" perform:self selector:@selector(addMessage:)];
Expand Down Expand Up @@ -176,7 +176,7 @@ id qs = @{
@"param1": @1,
@"param2": @"another"
};
SRConnection *connection = [SRConnection connectionWithURL:@"http://localhost/mysite" queryString:qs];
SRConnection *connection = [SRConnection connectionWithURLString:@"http://localhost/mysite" queryString:qs];
```

#### Hub Connections
Expand All @@ -185,7 +185,7 @@ id qs = @{
@"param1": @1,
@"param2": @"another"
};
SRHubConnection *hubConnection = [SRHubConnection connectionWithURL:@"http://localhost/mysite" queryString:qs];
SRHubConnection *hubConnection = [SRHubConnection connectionWithURLString:@"http://localhost/mysite" queryString:qs];
```
### Customizing Request Headers
Expand All @@ -196,11 +196,11 @@ id headers = @{
@"param1": @1,
@"param2": @"another"
};
SRConnection *connection = [SRConnection connectionWithURL:@"http://localhost/mysite"];
SRConnection *connection = [SRConnection connectionWithURLString:@"http://localhost/mysite"];
[connection setHeaders:headers];
//Alternative Usage
SRConnection *connection = [SRConnection connectionWithURL:@"http://localhost/mysite"];
SRConnection *connection = [SRConnection connectionWithURLString:@"http://localhost/mysite"];
[connection addValue:@"1" forHTTPHeaderField:@"param1"];
[connection addValue:@"another" forHTTPHeaderField:@"param2"];
```
Expand All @@ -211,11 +211,11 @@ id headers = @{
@"param1": @1,
@"param2": @"another"
};
SRHubConnection *hubConnection = [SRHubConnection connectionWithURL:@"http://localhost/mysite"];
SRHubConnection *hubConnection = [SRHubConnection connectionWithURLString:@"http://localhost/mysite"];
[hubConnection setHeaders:headers];

//Alternative Usage
SRHubConnection *hubConnection = [SRHubConnection connectionWithURL:@"http://localhost/mysite"];
SRHubConnection *hubConnection = [SRHubConnection connectionWithURLString:@"http://localhost/mysite"];
[hubConnection addValue:@"1" forHTTPHeaderField:@"param1"];
[hubConnection addValue:@"another" forHTTPHeaderField:@"param2"];
```
Expand Down

0 comments on commit b160ee4

Please sign in to comment.