Authorization keys in POST header

yomomma

Пользователь
Регистрация
17.02.2013
Сообщения
53
Благодарностей
2
Баллы
8
Content-Type: application/json
Authorization:
x-auth-key: 'dfsdf32s1df3s2d1fs32d1f',
x-auth-secret: 'sdfsd3w32e13we2r1'


I cam getting an error saying that the x-auth-key and x-auth-secret can not be read in POST module in Request Headers.

Anyone have a clue what to do?
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 771
Благодарностей
1 184
Баллы
113
Look in api documentation how browser is sending this request. Or if that's not api then you have to check this request in traffic monitor or using programs like fiddler.

I guess you have this formed wrong as usually its like,

Key: Value pairs.
 

yomomma

Пользователь
Регистрация
17.02.2013
Сообщения
53
Благодарностей
2
Баллы
8
{"ok":false,"reason":"x-auth-key or x-auth-secret missing"}


I get this error back.
 

myndeswx

Client
Регистрация
15.05.2017
Сообщения
420
Благодарностей
96
Баллы
28
Got to send the example from API documentation of how it should be sent, and how you are sending it, we can't help you other way :-)
 

yomomma

Пользователь
Регистрация
17.02.2013
Сообщения
53
Благодарностей
2
Баллы
8
Got to send the example from API documentation of how it should be sent, and how you are sending it, we can't help you other way :-)
These are the only 2 languages they give as example:

Python:

headers = { 'x-auth-key': '<Your-API-Key>', 'x-auth-secret': '<Your-API-Secret>', 'Accept': 'application/json', }

Curl:

-H 'x-auth-key: <Your-API-Key>' \ -H 'x-auth-secret: <Your-API-Secret>' \ -H "Content-type: application/json" \
 

BAZAg

Client
Регистрация
08.11.2015
Сообщения
1 767
Благодарностей
2 410
Баллы
113
These are the only 2 languages they give as example:

Python:

headers = { 'x-auth-key': '<Your-API-Key>', 'x-auth-secret': '<Your-API-Secret>', 'Accept': 'application/json', }

Curl:

-H 'x-auth-key: <Your-API-Key>' \ -H 'x-auth-secret: <Your-API-Secret>' \ -H "Content-type: application/json" \
C#:
// https://nghttp2.org/httpbin/get
string url = @"https://nghttp2.org/httpbin/post";
string proxy = "";
string UserAgent = project.Profile.UserAgent;
string[] headers = new[]{
    "x-auth-key: Your-API-Key" ,
    "x-auth-secret: Your-API-Secret"
};
string response = ZennoPoster.HTTP.Request(
  method: ZennoLab.InterfacesLibrary.Enums.Http.HttpMethod.POST,
  url: url,
  content: string.Empty,
  contentPostingType: @"application/json",
  proxy: proxy,
  Encoding: "UTF-8",
  respType:ZennoLab.InterfacesLibrary.Enums.Http.ResponceType.HeaderAndBody,
  Timeout: 30000,
  Cookies: string.Empty,
  UserAgent: UserAgent,
  UseRedirect: false,
  MaxRedirectCount: 0,
  AdditionalHeaders: headers,
  DownloadPath: null,
  UseOriginalUrl: true,
  throwExceptionOnError: true,
  cookieContainer: project.Profile.CookieContainer,
  removeDefaultHeaders: true
);
return response;
104772
 
  • Спасибо
Реакции: yomomma и myndeswx

yomomma

Пользователь
Регистрация
17.02.2013
Сообщения
53
Благодарностей
2
Баллы
8

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