Как прописать api token

Igorst

Client
Регистрация
07.08.2011
Сообщения
188
Благодарностей
16
Баллы
18
Привет,

как прописать api token,

есть такой запрос

ример вызова с помощью curl:

curl -k -X GET "https://postmaster.mail.ru/ext-api/reg-list/" -H 'Bearer: 6c5bf168b3d7852a0bdd66283e744b8099ca2303736'

с запросом https://postmaster.mail.ru/ext-api/reg-list/ все ясно,

но куда прописывать токен 6c5bf168b3d7852a0bdd66283e744b8099ca2303736

работаю с кубиком
 

ssXXXss

Client
Регистрация
23.12.2014
Сообщения
7 379
Благодарностей
2 039
Баллы
113
в параметр прописывай
 

Igorst

Client
Регистрация
07.08.2011
Сообщения
188
Благодарностей
16
Баллы
18
прописал в данные, но все равно нужный ответ не получаю


 

ssXXXss

Client
Регистрация
23.12.2014
Сообщения
7 379
Благодарностей
2 039
Баллы
113
во вкладке дополнительно
пишишь параметр, + значение
 

Igorst

Client
Регистрация
07.08.2011
Сообщения
188
Благодарностей
16
Баллы
18
у меня там только

есть поле

юзер агент и куки
 

doc

Client
Регистрация
30.03.2012
Сообщения
8 607
Благодарностей
4 600
Баллы
113

Igorst

Client
Регистрация
07.08.2011
Сообщения
188
Благодарностей
16
Баллы
18
Может я не туда копаю,
может нужно через c#

из справки маила

Пример вызова с помощью curl:


curl -k -X GET "https://postmaster.mail.ru/ext-api/reg-list/

"-H 'Bearer: 6c5bf168b3d7852a0bdd66283e744b8099ca2303736'

нужно получить



Ответ в формате JSON:


{"ok": true, "domains":[

{"domain":"alphadomain.ru"},

{"domain":"betadomain.ru"},

{"domain":"gammadomain.ru"}

]}



пробовал вписывать
 

doc

Client
Регистрация
30.03.2012
Сообщения
8 607
Благодарностей
4 600
Баллы
113
Может я не туда копаю,
может нужно через c#

из справки маила

Пример вызова с помощью curl:


curl -k -X GET "https://postmaster.mail.ru/ext-api/reg-list/

"-H 'Bearer: 6c5bf168b3d7852a0bdd66283e744b8099ca2303736'

нужно получить



Ответ в формате JSON:


{"ok": true, "domains":[

{"domain":"alphadomain.ru"},

{"domain":"betadomain.ru"},

{"domain":"gammadomain.ru"}

]}



пробовал вписывать
ну ты попробовал. Что в ответе?
 
  • Спасибо
Реакции: Igorst

Igorst

Client
Регистрация
07.08.2011
Сообщения
188
Благодарностей
16
Баллы
18
начало
HTTP/1.1 403 Forbidden
Server: nginx/1.9.2
Date: Sun, 02 Jun 2019 14:59:39 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked

для меня ни чего ценного.

если на вкладке json - там пусто
 

doc

Client
Регистрация
30.03.2012
Сообщения
8 607
Благодарностей
4 600
Баллы
113
начало
HTTP/1.1 403 Forbidden
Server: nginx/1.9.2
Date: Sun, 02 Jun 2019 14:59:39 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked

для меня ни чего ценного.

если на вкладке json - там пусто
а тела нет?
 

Igorst

Client
Регистрация
07.08.2011
Сообщения
188
Благодарностей
16
Баллы
18
Код:
HTTP/1.1 403 Forbidden
Server: nginx/1.9.2
Date: Sun, 02 Jun 2019 15:18:26 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: close
Vary: Accept, Cookie, Accept-Language
Content-Language: en
Allow: GET, HEAD, OPTIONS
Set-Cookie: csrftoken=k4UbYz2P77zF6P35BQz1bCkR13sBeoSy; expires=Sun, 31-May-2020 15:18:26 GMT; Max-Age=31449600; Path=/
Set-Cookie: sessionid=vgp7fxze3ypjjnqdgkik3sjl8rgwnwj2; expires=Sun, 16-Jun-2019 15:18:26 GMT; httponly; Max-Age=1209600; Path=/
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block; report=https://cspreport.mail.ru/xxssprotection
Content-Encoding: gzip




<!DOCTYPE html>
<html>
<head>
 

   
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
      <meta name="robots" content="NONE,NOARCHIVE" />
   

    <title>Django REST framework</title>

   
     
        <link rel="stylesheet" type="text/css" href="/static/rest_framework/css/bootstrap.min.css"/>
        <link rel="stylesheet" type="text/css" href="/static/rest_framework/css/bootstrap-tweaks.css"/>
     

      <link rel="stylesheet" type="text/css" href="/static/rest_framework/css/prettify.css"/>
      <link rel="stylesheet" type="text/css" href="/static/rest_framework/css/default.css"/>
   

 
</head>


<body class="">

  <div class="wrapper">
   
      <div class="navbar navbar-static-top navbar-inverse">
        <div class="container">
          <span>
           
              <a class='navbar-brand' rel="nofollow" href='http://www.django-rest-framework.org'>
                  Django REST framework <span class="version">3.2.3</span>
              </a>
           
          </span>
          <ul class="nav navbar-nav pull-right">
           
             
               
             
           
          </ul>
        </div>
      </div>
   

    <div class="container">
     
        <ul class="breadcrumb">
         
           
              <li class="active"><a href="/ext-api/reg-list/">Reg List</a></li>
           
         
        </ul>
     

      <!-- Content -->
      <div id="content">

       
          <form id="get-form" class="pull-right">
            <fieldset>
             
                <div class="btn-group format-selection">
                  <a class="btn btn-primary js-tooltip" href="/ext-api/reg-list/" rel="nofollow" title="Make a GET request on the Reg List resource">GET</a>

                  <button class="btn btn-primary dropdown-toggle js-tooltip" data-toggle="dropdown" title="Specify a format for the GET request">
                    <span class="caret"></span>
                  </button>
                  <ul class="dropdown-menu">
                   
                      <li>
                        <a class="js-tooltip format-option" href="/ext-api/reg-list/?format=json" rel="nofollow" title="Make a GET request on the Reg List resource with the format set to `json`">json</a>
                      </li>
                   
                      <li>
                        <a class="js-tooltip format-option" href="/ext-api/reg-list/?format=api" rel="nofollow" title="Make a GET request on the Reg List resource with the format set to `api`">api</a>
                      </li>
                   
                  </ul>
                </div>
             
            </fieldset>
          </form>
       

       
          <form class="button-form" action="/ext-api/reg-list/" method="POST">
            <input type='hidden' name='csrfmiddlewaretoken' value='k4UbYz2P77zF6P35BQz1bCkR13sBeoSy' />
            <input type="hidden" name="_method" value="OPTIONS" />
            <button class="btn btn-primary js-tooltip" title="Make an OPTIONS request on the Reg List resource">OPTIONS</button>
          </form>
       

       

          <div class="content-main">
            <div class="page-header">
                <h1>Reg List</h1>
            </div>
            <div style="float:left">
             
               
             
            </div>

           

            <div class="request-info" style="clear: both" >
              <pre class="prettyprint"><b>POST</b> /ext-api/reg-list/</pre>
            </div>

            <div class="response-info">
              <pre class="prettyprint"><span class="meta nocode"><b>HTTP 403 Forbidden</b>
<b>Content-Type:</b> <span class="lit">application/json</span>
<b>Vary:</b> <span class="lit">Accept</span>
<b>Allow:</b> <span class="lit">GET, HEAD, OPTIONS</span>

</span>{
    &quot;detail&quot;: &quot;CSRF Failed: Referer checking failed - no Referer.&quot;
}</pre>
            </div>
          </div>

         
      </div><!-- /.content -->
    </div><!-- /.container -->
  </div><!-- ./wrapper -->

 
    <script src="/static/rest_framework/js/jquery-1.8.1-min.js"></script>
    <script src="/static/rest_framework/js/bootstrap.min.js"></script>
    <script src="/static/rest_framework/js/prettify-min.js"></script>
    <script src="/static/rest_framework/js/default.js"></script>
 
</body>

</html>
 

Igorst

Client
Регистрация
07.08.2011
Сообщения
188
Благодарностей
16
Баллы
18
То что есть
 

Igorst

Client
Регистрация
07.08.2011
Сообщения
188
Благодарностей
16
Баллы
18
То что выставлял, может где что упустил

с типом данных и с галочками игрался.

Как по мне это самый правильный вариант, но ответ пустой


 

gevolushn

Известная личность
Регистрация
25.03.2019
Сообщения
518
Благодарностей
269
Баллы
63
То что выставлял, может где что упустил

с типом данных и с галочками игрался.

Как по мне это самый правильный вариант, но ответ пустой


Код какой в сниффере (панель "Трафик") возвращается?
 

doc

Client
Регистрация
30.03.2012
Сообщения
8 607
Благодарностей
4 600
Баллы
113

Igorst

Client
Регистрация
07.08.2011
Сообщения
188
Благодарностей
16
Баллы
18
код 200 есть, вот только в коде много мусора, но нужная информация есть

в конце куска кода указал "нужный сайт"

и почему он не ложиться в переменную

Код:
<!DOCTYPE html>
<html>
<head>
 

   
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
      <meta name="robots" content="NONE,NOARCHIVE" />
   

    <title>Django REST framework</title>

   
     
        <link rel="stylesheet" type="text/css" href="/static/rest_framework/css/bootstrap.min.css"/>
        <link rel="stylesheet" type="text/css" href="/static/rest_framework/css/bootstrap-tweaks.css"/>
     

      <link rel="stylesheet" type="text/css" href="/static/rest_framework/css/prettify.css"/>
      <link rel="stylesheet" type="text/css" href="/static/rest_framework/css/default.css"/>
   

 
</head>


<body class="">

  <div class="wrapper">
   
      <div class="navbar navbar-static-top navbar-inverse">
        <div class="container">
          <span>
           
              <a class='navbar-brand' rel="nofollow" href='http://www.django-rest-framework.org'>
                  Django REST framework <span class="version">3.2.3</span>
              </a>
           
          </span>
          <ul class="nav navbar-nav pull-right">
           
             
                &lt;li class=&quot;navbar-text&quot;&gt;[email protected]&lt;/li&gt;
             
           
          </ul>
        </div>
      </div>
   

    <div class="container">
     
        <ul class="breadcrumb">
         
           
              <li class="active"><a href="/ext-api/reg-list/">Reg List</a></li>
           
         
        </ul>
     

      <!-- Content -->
      <div id="content">

       
          <form id="get-form" class="pull-right">
            <fieldset>
             
                <div class="btn-group format-selection">
                  <a class="btn btn-primary js-tooltip" href="/ext-api/reg-list/" rel="nofollow" title="Make a GET request on the Reg List resource">GET</a>

                  <button class="btn btn-primary dropdown-toggle js-tooltip" data-toggle="dropdown" title="Specify a format for the GET request">
                    <span class="caret"></span>
                  </button>
                  <ul class="dropdown-menu">
                   
                      <li>
                        <a class="js-tooltip format-option" href="/ext-api/reg-list/?format=json" rel="nofollow" title="Make a GET request on the Reg List resource with the format set to `json`">json</a>
                      </li>
                   
                      <li>
                        <a class="js-tooltip format-option" href="/ext-api/reg-list/?format=api" rel="nofollow" title="Make a GET request on the Reg List resource with the format set to `api`">api</a>
                      </li>
                   
                  </ul>
                </div>
             
            </fieldset>
          </form>
       

       
          <form class="button-form" action="/ext-api/reg-list/" method="POST">
            <input type='hidden' name='csrfmiddlewaretoken' value='AV1VDa06lS7BSgP784W2B2ybHIkauroD' />
            <input type="hidden" name="_method" value="OPTIONS" />
            <button class="btn btn-primary js-tooltip" title="Make an OPTIONS request on the Reg List resource">OPTIONS</button>
          </form>
       

       

          <div class="content-main">
            <div class="page-header">
                <h1>Reg List</h1>
            </div>
            <div style="float:left">
             
                <p></p>
             
            </div>

           

            <div class="request-info" style="clear: both" >
              <pre class="prettyprint"><b>GET</b> /ext-api/reg-list/</pre>
            </div>

            <div class="response-info">
              <pre class="prettyprint"><span class="meta nocode"><b>HTTP 200 OK</b>
<b>Content-Type:</b> <span class="lit">application/json</span>
<b>Vary:</b> <span class="lit">Accept</span>
<b>Allow:</b> <span class="lit">GET, HEAD, OPTIONS</span>

</span>{
    &quot;domains&quot;: [
        {
            &quot;domain&quot;: &quot;нужный сайт&quot;
        },
 

gevolushn

Известная личность
Регистрация
25.03.2019
Сообщения
518
Благодарностей
269
Баллы
63
Итак.
1. Если вы из Украины, то поставьте для начала в запросе прокси, которые дают доступ к сервису mail.ru.
2. Ответ, по умолчанию, приходит в DOC Html... Почему так, спрашивайте у mail.ru.
HTML:
<!DOCTYPE html>
<html>
<head>

  
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
      <meta name="robots" content="NONE,NOARCHIVE" />
  

    <title>Django REST framework</title>

  
    
        <link rel="stylesheet" type="text/css" href="/static/rest_framework/css/bootstrap.min.css"/>
        <link rel="stylesheet" type="text/css" href="/static/rest_framework/css/bootstrap-tweaks.css"/>
    

      <link rel="stylesheet" type="text/css" href="/static/rest_framework/css/prettify.css"/>
      <link rel="stylesheet" type="text/css" href="/static/rest_framework/css/default.css"/>
  

</head>


<body class="">

  <div class="wrapper">
  
      <div class="navbar navbar-static-top navbar-inverse">
        <div class="container">
          <span>
          
              <a class='navbar-brand' rel="nofollow" href='http://www.django-rest-framework.org'>
                  Django REST framework <span class="version">3.2.3</span>
              </a>
          
          </span>
          <ul class="nav navbar-nav pull-right">
          
            
                &lt;li class=&quot;navbar-text&quot;&gt;[email protected]&lt;/li&gt;
            
          
          </ul>
        </div>
      </div>
  

    <div class="container">
    
        <ul class="breadcrumb">
        
          
              <li class="active"><a href="/ext-api/reg-list/">Reg List</a></li>
          
        
        </ul>
    

      <!-- Content -->
      <div id="content">

      
          <form id="get-form" class="pull-right">
            <fieldset>
            
                <div class="btn-group format-selection">
                  <a class="btn btn-primary js-tooltip" href="/ext-api/reg-list/" rel="nofollow" title="Make a GET request on the Reg List resource">GET</a>

                  <button class="btn btn-primary dropdown-toggle js-tooltip" data-toggle="dropdown" title="Specify a format for the GET request">
                    <span class="caret"></span>
                  </button>
                  <ul class="dropdown-menu">
                  
                      <li>
                        <a class="js-tooltip format-option" href="/ext-api/reg-list/?format=json" rel="nofollow" title="Make a GET request on the Reg List resource with the format set to `json`">json</a>
                      </li>
                  
                      <li>
                        <a class="js-tooltip format-option" href="/ext-api/reg-list/?format=api" rel="nofollow" title="Make a GET request on the Reg List resource with the format set to `api`">api</a>
                      </li>
                  
                  </ul>
                </div>
            
            </fieldset>
          </form>
      

      
          <form class="button-form" action="/ext-api/reg-list/" method="POST">
            <input type='hidden' name='csrfmiddlewaretoken' value='tQBNiGZMQqjBjf78inEhVVmX4QMxCWBt' />
            <input type="hidden" name="_method" value="OPTIONS" />
            <button class="btn btn-primary js-tooltip" title="Make an OPTIONS request on the Reg List resource">OPTIONS</button>
          </form>
      

      

          <div class="content-main">
            <div class="page-header">
                <h1>Reg List</h1>
            </div>
            <div style="float:left">
            
                <p></p>
            
            </div>

          

            <div class="request-info" style="clear: both" >
              <pre class="prettyprint"><b>GET</b> /ext-api/reg-list/</pre>
            </div>

            <div class="response-info">
              <pre class="prettyprint"><span class="meta nocode"><b>HTTP 200 OK</b>
<b>Content-Type:</b> <span class="lit">application/json</span>
<b>Vary:</b> <span class="lit">Accept</span>
<b>Allow:</b> <span class="lit">GET, HEAD, OPTIONS</span>

</span>{
    &quot;domains&quot;: [],
    &quot;ok&quot;: true
}</pre>
            </div>
          </div>

        

          

          
        
      </div><!-- /.content -->
    </div><!-- /.container -->
  </div><!-- ./wrapper -->

    <script src="/static/rest_framework/js/jquery-1.8.1-min.js"></script>
    <script src="/static/rest_framework/js/bootstrap.min.js"></script>
    <script src="/static/rest_framework/js/prettify-min.js"></script>
    <script src="/static/rest_framework/js/default.js"></script>
</body>

</html>
3. Поизучав html код можно увидеть, что нужно дописывать ?format=json.
1.png

2.png
 
Последнее редактирование:
  • Спасибо
Реакции: impul5e и Igorst

gevolushn

Известная личность
Регистрация
25.03.2019
Сообщения
518
Благодарностей
269
Баллы
63

Igorst

Client
Регистрация
07.08.2011
Сообщения
188
Благодарностей
16
Баллы
18
Denomm, вы просто супер

добавочка ?format=json помогла
 

Igorst

Client
Регистрация
07.08.2011
Сообщения
188
Благодарностей
16
Баллы
18
Но если задать другой запрос
https://postmaster.mail.ru/ext-api/stat-list/?date_from=2018-04-25?format=json (со своими данными)

хоть с приставкой, хоть нет - нужный ответ не получаю

хотя по идеи все должно быть по аналогии

Код:
e!DOCTYPE html>
ehtml>
ehead>
 

   
      emeta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
      emeta name="robots" content="NONE,NOARCHIVE" />
   

    etitle>Django REST frameworke/title>

   
     
        elink rel="stylesheet" type="text/css" href="/static/rest_framework/css/bootstrap.min.css"/>
        elink rel="stylesheet" type="text/css" href="/static/rest_framework/css/bootstrap-tweaks.css"/>
     

      elink rel="stylesheet" type="text/css" href="/static/rest_framework/css/prettify.css"/>
      elink rel="stylesheet" type="text/css" href="/static/rest_framework/css/default.css"/>
   

 
e/head>


ebody class="">

  ediv class="wrapper">
   
      ediv class="navbar navbar-static-top navbar-inverse">
        ediv class="container">
          espan>
           
              ea class='navbar-brand' rel="nofollow" href='http://www.django-rest-framework.org'>
                  Django REST framework espan class="version">3.2.3e/span>
              e/a>
           
          e/span>
          eul class="nav navbar-nav pull-right">
           
             
                &lt;li class=&quot;navbar-text&quot;&gt;[email protected]&lt;/li&gt;
             
           
          e/ul>
        e/div>
      e/div>
   

    ediv class="container">
     
        eul class="breadcrumb">
         
           
              eli class="active">ea href="/ext-api/stat-list-detailed/">Stat List Detailede/a>e/li>
           
         
        e/ul>
     

      e!-- Content -->
      ediv id="content">

       
          eform id="get-form" class="pull-right">
            efieldset>
             
                ediv class="btn-group format-selection">
                  ea class="btn btn-primary js-tooltip" href="/ext-api/stat-list-detailed/?domain=сайт.com&amp;date_from=2019-06-03&amp;date_to=2019-06-03" rel="nofollow" title="Make a GET request on the Stat List Detailed resource">GETe/a>

                  ebutton class="btn btn-primary dropdown-toggle js-tooltip" data-toggle="dropdown" title="Specify a format for the GET request">
                    espan class="caret">e/span>
                  e/button>
                  eul class="dropdown-menu">
                   
                      eli>
                        ea class="js-tooltip format-option" href="/ext-api/stat-list-detailed/?date_from=2019-06-03&amp;date_to=2019-06-03&amp;domain=сайт.com&amp;format=json" rel="nofollow" title="Make a GET request on the Stat List Detailed resource with the format set to `json`">jsone/a>
                      e/li>
                   
                      eli>
                        ea class="js-tooltip format-option" href="/ext-api/stat-list-detailed/?date_from=2019-06-03&amp;date_to=2019-06-03&amp;domain=сайт.com&amp;format=api" rel="nofollow" title="Make a GET request on the Stat List Detailed resource with the format set to `api`">apie/a>
                      e/li>
                   
                  e/ul>
                e/div>
             
            e/fieldset>
          e/form>
       

       
          eform class="button-form" action="/ext-api/stat-list-detailed/?domain=сайт.com&amp;date_from=2019-06-03&amp;date_to=2019-06-03" method="POST">
            einput type='hidden' name='csrfmiddlewaretoken' value='73oHCbVo0uihXOE2AUakbzsYas61AVig' />
            einput type="hidden" name="_method" value="OPTIONS" />
            ebutton class="btn btn-primary js-tooltip" title="Make an OPTIONS request on the Stat List Detailed resource">OPTIONSe/button>
          e/form>
       

       

          ediv class="content-main">
            ediv class="page-header">
                eh1>Stat List Detailede/h1>
            e/div>
            ediv style="float:left">
             
                ep>e/p>
             
            e/div>

           

            ediv class="request-info" style="clear: both" >
              epre class="prettyprint">eb>GETe/b> /ext-api/stat-list-detailed/?domain=сайт.com&amp;date_from=2019-06-03&amp;date_to=2019-06-03e/pre>
            e/div>

            ediv class="response-info">
              epre class="prettyprint">espan class="meta nocode">eb>HTTP 200 OKe/b>
eb>Content-Type:e/b> espan class="lit">application/jsone/span>
eb>Vary:e/b> espan class="lit">Accepte/span>
eb>Allow:e/b> espan class="lit">GET, HEAD, OPTIONSe/span>

e/span>{
    &quot;data&quot;: [
        {
            &quot;domain&quot;: &quot;ea href="http://сайт.com" rel="nofollow">сайт.come/a>&quot;,
            &quot;data&quot;: []
        }
    ],
    &quot;ok&quot;: true
}e/pre>
            e/div>
          e/div>

         

           

           
         
      e/div>e!-- /.content -->
    e/div>e!-- /.container -->
  e/div>e!-- ./wrapper -->

 
    escript src="/static/rest_framework/js/jquery-1.8.1-min.js">e/script>
    escript src="/static/rest_framework/js/bootstrap.min.js">e/script>
    escript src="/static/rest_framework/js/prettify-min.js">e/script>
    escript src="/static/rest_framework/js/default.js">e/script>
 
e/body>

e/html>

 

doc

Client
Регистрация
30.03.2012
Сообщения
8 607
Благодарностей
4 600
Баллы
113
Но если задать другой запрос
https://postmaster.mail.ru/ext-api/stat-list/?date_from=2018-04-25?format=json (со своими данными)

хоть с приставкой, хоть нет - нужный ответ не получаю

хотя по идеи все должно быть по аналогии

Код:
e!DOCTYPE html>
ehtml>
ehead>


  
      emeta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
      emeta name="robots" content="NONE,NOARCHIVE" />
  

    etitle>Django REST frameworke/title>

  
    
        elink rel="stylesheet" type="text/css" href="/static/rest_framework/css/bootstrap.min.css"/>
        elink rel="stylesheet" type="text/css" href="/static/rest_framework/css/bootstrap-tweaks.css"/>
    

      elink rel="stylesheet" type="text/css" href="/static/rest_framework/css/prettify.css"/>
      elink rel="stylesheet" type="text/css" href="/static/rest_framework/css/default.css"/>
  


e/head>


ebody class="">

  ediv class="wrapper">
  
      ediv class="navbar navbar-static-top navbar-inverse">
        ediv class="container">
          espan>
          
              ea class='navbar-brand' rel="nofollow" href='http://www.django-rest-framework.org'>
                  Django REST framework espan class="version">3.2.3e/span>
              e/a>
          
          e/span>
          eul class="nav navbar-nav pull-right">
          
            
                &lt;li class=&quot;navbar-text&quot;&gt;[email protected]&lt;/li&gt;
            
          
          e/ul>
        e/div>
      e/div>
  

    ediv class="container">
    
        eul class="breadcrumb">
        
          
              eli class="active">ea href="/ext-api/stat-list-detailed/">Stat List Detailede/a>e/li>
          
        
        e/ul>
    

      e!-- Content -->
      ediv id="content">

      
          eform id="get-form" class="pull-right">
            efieldset>
            
                ediv class="btn-group format-selection">
                  ea class="btn btn-primary js-tooltip" href="/ext-api/stat-list-detailed/?domain=сайт.com&amp;date_from=2019-06-03&amp;date_to=2019-06-03" rel="nofollow" title="Make a GET request on the Stat List Detailed resource">GETe/a>

                  ebutton class="btn btn-primary dropdown-toggle js-tooltip" data-toggle="dropdown" title="Specify a format for the GET request">
                    espan class="caret">e/span>
                  e/button>
                  eul class="dropdown-menu">
                  
                      eli>
                        ea class="js-tooltip format-option" href="/ext-api/stat-list-detailed/?date_from=2019-06-03&amp;date_to=2019-06-03&amp;domain=сайт.com&amp;format=json" rel="nofollow" title="Make a GET request on the Stat List Detailed resource with the format set to `json`">jsone/a>
                      e/li>
                  
                      eli>
                        ea class="js-tooltip format-option" href="/ext-api/stat-list-detailed/?date_from=2019-06-03&amp;date_to=2019-06-03&amp;domain=сайт.com&amp;format=api" rel="nofollow" title="Make a GET request on the Stat List Detailed resource with the format set to `api`">apie/a>
                      e/li>
                  
                  e/ul>
                e/div>
            
            e/fieldset>
          e/form>
      

      
          eform class="button-form" action="/ext-api/stat-list-detailed/?domain=сайт.com&amp;date_from=2019-06-03&amp;date_to=2019-06-03" method="POST">
            einput type='hidden' name='csrfmiddlewaretoken' value='73oHCbVo0uihXOE2AUakbzsYas61AVig' />
            einput type="hidden" name="_method" value="OPTIONS" />
            ebutton class="btn btn-primary js-tooltip" title="Make an OPTIONS request on the Stat List Detailed resource">OPTIONSe/button>
          e/form>
      

      

          ediv class="content-main">
            ediv class="page-header">
                eh1>Stat List Detailede/h1>
            e/div>
            ediv style="float:left">
            
                ep>e/p>
            
            e/div>

          

            ediv class="request-info" style="clear: both" >
              epre class="prettyprint">eb>GETe/b> /ext-api/stat-list-detailed/?domain=сайт.com&amp;date_from=2019-06-03&amp;date_to=2019-06-03e/pre>
            e/div>

            ediv class="response-info">
              epre class="prettyprint">espan class="meta nocode">eb>HTTP 200 OKe/b>
eb>Content-Type:e/b> espan class="lit">application/jsone/span>
eb>Vary:e/b> espan class="lit">Accepte/span>
eb>Allow:e/b> espan class="lit">GET, HEAD, OPTIONSe/span>

e/span>{
    &quot;data&quot;: [
        {
            &quot;domain&quot;: &quot;ea href="http://сайт.com" rel="nofollow">сайт.come/a>&quot;,
            &quot;data&quot;: []
        }
    ],
    &quot;ok&quot;: true
}e/pre>
            e/div>
          e/div>

        

          

          
        
      e/div>e!-- /.content -->
    e/div>e!-- /.container -->
  e/div>e!-- ./wrapper -->


    escript src="/static/rest_framework/js/jquery-1.8.1-min.js">e/script>
    escript src="/static/rest_framework/js/bootstrap.min.js">e/script>
    escript src="/static/rest_framework/js/prettify-min.js">e/script>
    escript src="/static/rest_framework/js/default.js">e/script>

e/body>

e/html>
там уже есть вопросительный знак. В таком случае нужно использовать амперсант
 
  • Спасибо
Реакции: Igorst

gevolushn

Известная личность
Регистрация
25.03.2019
Сообщения
518
Благодарностей
269
Баллы
63
Но если задать другой запрос
https://postmaster.mail.ru/ext-api/stat-list/?date_from=2018-04-25?format=json (со своими данными)

хоть с приставкой, хоть нет - нужный ответ не получаю

хотя по идеи все должно быть по аналогии

Код:
e!DOCTYPE html>
ehtml>
ehead>


 
      emeta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
      emeta name="robots" content="NONE,NOARCHIVE" />
 

    etitle>Django REST frameworke/title>

 
   
        elink rel="stylesheet" type="text/css" href="/static/rest_framework/css/bootstrap.min.css"/>
        elink rel="stylesheet" type="text/css" href="/static/rest_framework/css/bootstrap-tweaks.css"/>
   

      elink rel="stylesheet" type="text/css" href="/static/rest_framework/css/prettify.css"/>
      elink rel="stylesheet" type="text/css" href="/static/rest_framework/css/default.css"/>
 


e/head>


ebody class="">

  ediv class="wrapper">
 
      ediv class="navbar navbar-static-top navbar-inverse">
        ediv class="container">
          espan>
         
              ea class='navbar-brand' rel="nofollow" href='http://www.django-rest-framework.org'>
                  Django REST framework espan class="version">3.2.3e/span>
              e/a>
         
          e/span>
          eul class="nav navbar-nav pull-right">
         
           
                &lt;li class=&quot;navbar-text&quot;&gt;[email protected]&lt;/li&gt;
           
         
          e/ul>
        e/div>
      e/div>
 

    ediv class="container">
   
        eul class="breadcrumb">
       
         
              eli class="active">ea href="/ext-api/stat-list-detailed/">Stat List Detailede/a>e/li>
         
       
        e/ul>
   

      e!-- Content -->
      ediv id="content">

     
          eform id="get-form" class="pull-right">
            efieldset>
           
                ediv class="btn-group format-selection">
                  ea class="btn btn-primary js-tooltip" href="/ext-api/stat-list-detailed/?domain=сайт.com&amp;date_from=2019-06-03&amp;date_to=2019-06-03" rel="nofollow" title="Make a GET request on the Stat List Detailed resource">GETe/a>

                  ebutton class="btn btn-primary dropdown-toggle js-tooltip" data-toggle="dropdown" title="Specify a format for the GET request">
                    espan class="caret">e/span>
                  e/button>
                  eul class="dropdown-menu">
                 
                      eli>
                        ea class="js-tooltip format-option" href="/ext-api/stat-list-detailed/?date_from=2019-06-03&amp;date_to=2019-06-03&amp;domain=сайт.com&amp;format=json" rel="nofollow" title="Make a GET request on the Stat List Detailed resource with the format set to `json`">jsone/a>
                      e/li>
                 
                      eli>
                        ea class="js-tooltip format-option" href="/ext-api/stat-list-detailed/?date_from=2019-06-03&amp;date_to=2019-06-03&amp;domain=сайт.com&amp;format=api" rel="nofollow" title="Make a GET request on the Stat List Detailed resource with the format set to `api`">apie/a>
                      e/li>
                 
                  e/ul>
                e/div>
           
            e/fieldset>
          e/form>
     

     
          eform class="button-form" action="/ext-api/stat-list-detailed/?domain=сайт.com&amp;date_from=2019-06-03&amp;date_to=2019-06-03" method="POST">
            einput type='hidden' name='csrfmiddlewaretoken' value='73oHCbVo0uihXOE2AUakbzsYas61AVig' />
            einput type="hidden" name="_method" value="OPTIONS" />
            ebutton class="btn btn-primary js-tooltip" title="Make an OPTIONS request on the Stat List Detailed resource">OPTIONSe/button>
          e/form>
     

     

          ediv class="content-main">
            ediv class="page-header">
                eh1>Stat List Detailede/h1>
            e/div>
            ediv style="float:left">
           
                ep>e/p>
           
            e/div>

         

            ediv class="request-info" style="clear: both" >
              epre class="prettyprint">eb>GETe/b> /ext-api/stat-list-detailed/?domain=сайт.com&amp;date_from=2019-06-03&amp;date_to=2019-06-03e/pre>
            e/div>

            ediv class="response-info">
              epre class="prettyprint">espan class="meta nocode">eb>HTTP 200 OKe/b>
eb>Content-Type:e/b> espan class="lit">application/jsone/span>
eb>Vary:e/b> espan class="lit">Accepte/span>
eb>Allow:e/b> espan class="lit">GET, HEAD, OPTIONSe/span>

e/span>{
    &quot;data&quot;: [
        {
            &quot;domain&quot;: &quot;ea href="http://сайт.com" rel="nofollow">сайт.come/a>&quot;,
            &quot;data&quot;: []
        }
    ],
    &quot;ok&quot;: true
}e/pre>
            e/div>
          e/div>

       

         

         
       
      e/div>e!-- /.content -->
    e/div>e!-- /.container -->
  e/div>e!-- ./wrapper -->


    escript src="/static/rest_framework/js/jquery-1.8.1-min.js">e/script>
    escript src="/static/rest_framework/js/bootstrap.min.js">e/script>
    escript src="/static/rest_framework/js/prettify-min.js">e/script>
    escript src="/static/rest_framework/js/default.js">e/script>

e/body>

e/html>
Если вы добавляете второй и последующие параметры, то ставьте вместо ? - &. ? надо ставить только перед первым параметром, а & для остальных (& - and/еще/и/амперсанд).
 
  • Спасибо
Реакции: Igorst

Igorst

Client
Регистрация
07.08.2011
Сообщения
188
Благодарностей
16
Баллы
18
Ребята, все получилось

Всем спасибо
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)