Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Import danych JSON
Sumer
post
Post #1





Grupa: Zarejestrowani
Postów: 3
Pomógł: 0
Dołączył: 19.12.2007

Ostrzeżenie: (0%)
-----


Api zwraca informacje w postaci JSONa.

Host: http://185.49.12.149:8083/ApiRest/
W nagłówku żądania należy dodać parametr "key-name" z wartością "gf5h48gf-df56gh4gf8-56fg4".

Próbowałem już na różne sposoby, poniżej podaję jeden z kodów który stosowałem:
Kod
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "http://185.39.72.159:8083/ApiRest/",
  "method": "GET",
  "headers": {
    "key-name": "gf5h48gf-df56gh4gf8-56fg4"
  }
}
$.ajax(settings).done(function (response) {
  console.log(response);
});

Jednak ciągle nie mogę pobrać danych.

Ten post edytował Sumer 23.10.2016, 14:46:13
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
Pyton_000
post
Post #2





Grupa: Zarejestrowani
Postów: 8 068
Pomógł: 1414
Dołączył: 26.10.2005

Ostrzeżenie: (0%)
-----


Zobacz w DevelopersTools jaki request idzie i jakie nagłówki ma.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 19.08.2025 - 16:14