GET and POST request advice please

bambinou

Client
Регистрация
22.08.2011
Сообщения
442
Благодарностей
21
Баллы
18
Hello,

I am trying to initiate my first GET and POST request using Zenno.

For the GET, I added an HTTP GET block with:

110551



In More:
110552



But I am getting this error:
110553


I know the API works perfectly as I have tested it with Postman.

But via Zenno I cannot work out the proper writing for the bearer and header in general.

Any idea how to write it properly please?

"Accept", "application/json"
"Content-Type", "application/json"
"Authorization", "Bearer 17|xyVKY5nKO6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf1cld"

Thanks
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
Your showed error is not from GET action but from some other C# action.

Double click this red x in error and you will see highlighted C# action with this error.
 

bambinou

Client
Регистрация
22.08.2011
Сообщения
442
Благодарностей
21
Баллы
18
Thank you so much.
Yes you were right ;-)
The error came from some Code I had below it.

The request kind of works but I am receiving this below. But I am also using postman and I can guarantee that the GET request works and I receive a response. With Zenno, I am not receiving anything apart form the below page. Any idea what could be wrong in the GET settings please?
The response should be json.

Thanks

[ CODE = csharp ] <!DOCTYPE html >
< html lang = "en" >
< head >
< meta charset = "utf-8" >
< meta name = "viewport" content = "width = device-width, initial-scale = 1" >
< title > Not Found < / title >

< link rel = "dns-prefetch" href = "//fonts.gstatic.com" >
< link href = "https://fonts.googleapis.com/css?family=Nunito" rel =" stylesheet ">

< style >
html, body {
background-color: #fff;
color: # 636b6f;
font-family: 'Nunito', sans-serif;
font-weight: 100;
height: 100vh;
margin: 0;
}

.full-height {
height: 100vh;
}

.flex-center {
align-items: center;
display: flex;
justify-content: center;
}

.position-ref {
position: relative;
}

.code {
border-right: 2px solid;
font-size: 26px;
padding: 0 15px 0 15px;
text-align: center;
}

.message {
font-size: 18px;
text-align: center;
}
< / style >
< / head >
< body >
< div class = "flex-center position-ref full-height" >
< div class = "code" >
404 < / div >
< div class = "message" style = "padding: 10px;" >
Not Found < / div >
< / div >
< / body >
< / html >
[ / CODE ]
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
Obviously something is different. As you get code 404 - Not Found back

Investigate what exactly the postman sends and what exactly zenno sends.
Maybe some headers are wrong or something.
Also, as I see, you selected to load only headers. You probably need Content only.
Use Fiddler or some other http tracking tool.
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113

bambinou

Client
Регистрация
22.08.2011
Сообщения
442
Благодарностей
21
Баллы
18
Thank you so much, trying now.
 

bambinou

Client
Регистрация
22.08.2011
Сообщения
442
Благодарностей
21
Баллы
18
Actually I am looking at it now, why would you set a browser agent for an API call? I am only doing a request without any need of a browser.
 

bambinou

Client
Регистрация
22.08.2011
Сообщения
442
Благодарностей
21
Баллы
18
You were right the browser agent was the issue....this is so weird, I have never setup a browser agent for an API request to a Laravel API. I am not really understanding the need for it to be honest.
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
User-Agent is part of request headers. Postman also sends it. Its something like: PostmanRuntime/7.29.0 or similar.
 
  • Спасибо
Реакции: bambinou

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
526
Благодарностей
112
Баллы
43
You can make it a littbe bit easy, just navigate to your api on browser and watch traffic window, right click on desired data and create action from request.

110580
 
  • Спасибо
Реакции: noname007 и bambinou

bambinou

Client
Регистрация
22.08.2011
Сообщения
442
Благодарностей
21
Баллы
18

myndeswx

Client
Регистрация
15.05.2017
Сообщения
436
Благодарностей
104
Баллы
43

bambinou

Client
Регистрация
22.08.2011
Сообщения
442
Благодарностей
21
Баллы
18
  • Спасибо
Реакции: myndeswx

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