Payal Bhatia
Payal Bhatia

Reputation: 67

Extracting from Sharepoint using Python and REST api

What is meaning of {0}/{1} in http://server/site/{0}/{1}/_api/web/lists/GetByTitle

Upvotes: 0

Views: 313

Answers (2)

Amos
Amos

Reputation: 2091

The {0}/{1} should be placeholders.

Python String format() Method:The Placeholders enter image description here

Upvotes: 1

user459872
user459872

Reputation: 24827

Here, Brace characters ('curly braces') are used to indicate replacement fields within the string:

Let's say you have this string,

my_string = "http://server/site/{0}/{1}/_api/web/lists/GetByTitle"

and later in the code you can supply values for this replacement fields with string format function.

>>> my_string.format("first", "second")
'http://server/site/first/second/_api/web/lists/GetByTitle'

Here {0} will gets replaced with the first argument to the format function(first) and {1} will gets replaced with the second argument to the format function(second)

Upvotes: 1

Related Questions