GET and POST request advice please

  • Автор темы Автор темы bambinou
  • Дата начала Дата начала

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
 
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 ]
 
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.
 
Thank you so much, trying now.
 
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.
 
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.
 
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

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