Error when run test in my collection

dear Mr
i have to learn about api and tray to get it
i have collection from friend

https://www.postman.com/collections/94db931dc503afd508a5
and when tray to post get error 404 ?
and the next ?

POST http://{{url}}login/

Error: DNSLookup: EBADNAME {{url}}login

  • :play_button:Network
  1. agent: “Cloud Agent”

:play_button:Request Headers

lang: ar

Content-Type: application/json

User-Agent: PostmanRuntime/7.44.0

Accept: /

Cache-Control: no-cache

Postman-Token: 138d1cb4-da82-4809-9565-89c7b152bf56

Host: {{url}}login

Accept-Encoding: gzip, deflate, br

Connection: keep-alive

:play_button:Request Body
can you help me

by any chance did you forgot to define {{url}} variable ??

In Postman, {{url}} is a variable placeholder. That means Postman is expecting you to define what {{url}} actually is (like http://127.0.0.1:8000 or your hosted domain).

But right now, Postman doesn’t know what {{url}} means — so it’s literally trying to request http://{{url}}login, which is invalid (hence the DNS error).

so you need to define the {{url}} for your collection
tell me if you need the guidance for how to define it

thank you
can you help me to get the guidance for how to define it

sure,

1st method :
you can remove http://{{url}} and place your domain for every request manually.

2nd method : set as environment variable

  1. select Environments in the sidebar and select an environment.
  2. To add a new variable, select the bottom row of the table and enter a Variable name. which will be in your case url and value will be 127.0.0.1:8000/ (since http: is already added in your request we will not add that over here and don’t forgot to add the ‘/’ after your value)

3rd method : set as global or collection variable

  1. you can either set as global variable this variable will be set as globally
  2. you can set it as collection variable this variable will only be available in only this collection
  3. values and variable name will be same as above

if you still get the error let me know

I personally suggest you to go with global variable also suggest you that if it is possible remove the http:// from your request (avoid typing it manually in every request) instead add that with this variable like this https:://127.0.0.1:8000/ all together

here, official document link : Store and reuse values using variables | Postman Docs

dear mr
thank you for your respond
but i have still get the error

POST http://127.0.0.1:8000/login

Error: connect ECONNREFUSED 127.0.0.1:8000

:play_button:Request Headers

lang: ar

Content-Type: application/json

User-Agent: PostmanRuntime/7.44.0

Accept: /

Postman-Token: 99b91bb5-8901-465f-aa3f-8ff451b24af5

Host: 127.0.0.1:8000

Accept-Encoding: gzip, deflate, br

Connection: keep-alive

:play_button:Request Body

This means your request can’t reach backend at 127.0.0.1:8000. The connection is actively refused, which usually means the server isn’t running or listening on a different port/IP.

do you have only postman collection of your friend or do you a have that APIs (Code) also ?

can you tell me in which domain are you running your project(Code) ? that domain should be your value

dear mr this the collection link
https://www.postman.com/collections/94db931dc503afd508a5

you re sure this is the https://student.valuxapps.com the host name because i run that register API and it is telling me that this page doesn’t exist to me

look.. your variable is set perfectly fine :+1: i don’t see any problem with that

if you are getting the error give me the screenshot I’ll help as much as i can :blush:

dear mr
i had learning flutter and in section to shop app
and get this api’s
but didnot work good like you see
can we reset this api
or help me to get another api to complete learning

here i only able to find this api collection for you you can download and practice login is maybe fake so don’t know check out your self

dear Srushti
thank you about your kindness very much

@ahmedsa3id most welcome :hugs: feel free to get in touch if you have any problem I’ll be happy to help .