Skip to content

Commit b2b35a4

Browse files
committed
Deprecate 'Set HTTP Host'. Use 'Create HTTP Context'.
1 parent 6d1ef22 commit b2b35a4

File tree

6 files changed

+9
-12
lines changed

6 files changed

+9
-12
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Library HttpLibrary.HTTP
3939
============ ================================= ===================================
4040
Example
4141
\ [Documentation] Follows a Redirect
42-
\ Set HTTP Host `httpstat.us <http://httpstat.us>`_
42+
\ Create HTTP Context `httpstat.us <http://httpstat.us>`_
4343
\ GET /302
4444
\ Response Status Code Should Equal 302
4545
\ Follow Response

src/HttpLibrary/__init__.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def context(self):
119119
@property
120120
def app(self):
121121
if not self.context.app:
122-
raise Exception('Not connected to any HTTP Host. Use "Set HTTP Host" keyword first.')
122+
raise Exception('Not connected to any HTTP Host. Use "Create HTTP Context" keyword first.')
123123
return self.context.app
124124

125125
@property
@@ -145,10 +145,7 @@ def _path_from_url_or_path(self, url_or_path):
145145

146146
def set_http_host(self, host):
147147
"""
148-
(deprecated) Sets the HTTP host to use for future requests. You must call this
149-
before issuing any HTTP requests.
150-
151-
`host` is the name of the host, optionally with port (e.g. 'google.com' or 'localhost:5984')
148+
*DEPRECATED* Use `Create HTTP Context` instead.
152149
"""
153150
self.create_http_context(host)
154151

tests/http/__init__.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ Start Mockserver
1515
Sleep 0.2
1616

1717
Stop Mockserver
18-
Set HTTP Host ${HOST}
18+
Create HTTP Context ${HOST}
1919
POST /kill
2020

tests/http/scoping/simplescope.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Resource ../../variables.txt
44
Library HttpLibrary.HTTP
5-
Suite Setup Set HTTP Host ${HOST}
5+
Suite Setup Create HTTP Context ${HOST}
66

77
*** Test Cases ***
88

tests/http/scoping/suite_setup.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Resource ../../variables.txt
44
Library HttpLibrary.HTTP
5-
Suite Setup Set HTTP Host ${HOST}
5+
Suite Setup Create HTTP Context ${HOST}
66

77
*** Test Cases ***
88

tests/http/simple.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
Resource ../variables.txt
44
Library HttpLibrary.HTTP
5-
Test Setup Set HTTP Host ${HOST}
5+
Test Setup Create HTTP Context ${HOST}
66

77
*** Test Cases ***
88

99
Error if GET before connect
1010
[Setup] No Operation
1111
Run Keyword And Expect Error
12-
... Not connected to any HTTP Host. Use "Set HTTP Host" keyword first.
12+
... Not connected to any HTTP Host. Use "Create HTTP Context" keyword first.
1313
... GET /
1414

1515
Error if invalid URL
@@ -235,7 +235,7 @@ Name-based virtual hosting is supported
235235
# "Host" request header set to "www.example.com"
236236
# See https://en.wikipedia.org/wiki/Virtual_hosting#Name-based
237237

238-
Set HTTP Host ${HOST}
238+
Create HTTP Context ${HOST}
239239
Set Request Header Host www.example.com
240240
GET /hostname
241241

0 commit comments

Comments
 (0)