Authorization keys in POST header

yomomma

Пользователь
Joined
Feb 17, 2013
Messages
53
Reaction score
2
Points
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
Joined
Feb 1, 2012
Messages
4,771
Reaction score
1,184
Points
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

Пользователь
Joined
Feb 17, 2013
Messages
53
Reaction score
2
Points
8
{"ok":false,"reason":"x-auth-key or x-auth-secret missing"}


I get this error back.
 

myndeswx

Client
Joined
May 15, 2017
Messages
424
Reaction score
99
Points
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

Пользователь
Joined
Feb 17, 2013
Messages
53
Reaction score
2
Points
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
Joined
Nov 8, 2015
Messages
1,767
Reaction score
2,414
Points
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

Пользователь
Joined
Feb 17, 2013
Messages
53
Reaction score
2
Points
8

Users Who Are Viewing This Thread (Total: 1, Members: 0, Guests: 1)