Hello! I understand authentication using OAuth. My task is to send a POST request to the server, passing some data. With an empty POST request (without the transmitted data in the body), I figured it out. The signature on the server comes right. The server only informs me that I did not send any data. In this regard, I have two interrelated questions. Explain to me, please, do I need to add this data, which should be sent in the request body, to the base string for further generation of oauth_signature? And actually, in what form will this data after the header in the request I have to send to the server? An example of the data that should be transmitted to the server:

category:1 title:Енисей description:Краткое описание message:Полное описание other1:Омск other2:ул. Пролетарская, 22 other3:54.9782695,73.3381964 other4:88002000600 other5:direktor@zarplaty.net 

P. s under the second question I meant not what data I need to send, but how correctly should I form them in the request body (name 1: value 1 or name 1 = value 1)? And what between these data should be signs (comma or &)? The API documentation itself does not show the final appearance of the request body. I only know that it should not be json, but a simple associative array (shown in the example in the php documentation). But I am writing an application in another language. Thank you for your reply!

    1 answer 1

    Option two or serialize data, like this:

     $.ajax({ type: "POST", url: "some.php", data: "category=1&title=Енисей" }); 

    either form an array from the data (ie an object in js) and send it to a server where you can accept them like this:

      var data = [ тут ваши данные в виде ассоцитивного массива]; $.ajax({ url: "page.php", processData: false, data: data }); 

    or in pieces:

     $.ajax({ url: "page.php", processData: false, data: {category:1,title:'Енисей'/*... и тд*/} }); 
    • Thanks for the tip. I was interested in the extremely raw view of the body of the POST request. Not an implementation in java script, since the application will be written in java. Now I am trying to authenticate using a browser application, where the entire POST request needs to be made by myself without using programming languages. - Sergey
    • I honestly don’t really understand how you want to make a POST without any programming language ... - Broouzer King
    • I, of course, compose the oauth_nonce and oauth_signature parameters using a programming language (in java), but I make the entire request using the Google Chrome Advanced Rest Client application, where the type of request itself is made manually without programming. I use this utility to understand what data I need to send to the server in the future. - Sergey