Web Api - httppost - The requested resource does not support http method Get after publish on production server - asp.net

when i add profile of supplier on localhost working fine. and API POSt method is working fine.
but after publish of project on server getting 400 error when i add profile of supplier.
and in response getting this.
The requested resource does not support http method 'GET'.
with 400 status
i have attached images of errors.
Project url is :
https://localefood.maqssoft.com
test-user : supplier#gmail.com
password: a#123456A
This link has the same issue that i am looking for but not give the solution of problem.
https://forums.asp.net/t/2129791.aspx
enter image description here

Make a POST request with POSTMAN.
List item Use the same URL as you did for the GET request steps above, but now choose POST to be the selected HTTP method.
Click the Body tab just under the URL, then choose the raw radio
button and JSON (application/json) from the type dropdown menu:
You may note that a new Header gets automatically added to the
request. Requests that send data need a header telling the API what
kind of data is being sent. Click the Headers tab to see the
Content-Type: application/json header:
Click Send.
If you have recently submitted a request you may not be asked to
authenticate again. If you get an Unauthorized error, request a new
access token and click Send again.

Related

Sending a Get Request (to the source site) Before Answering a Post Request

I am testing a controlling algorithm. I am using windows-hosting/plesk and c#.
I am having a problem like this:
My hosting account is called myhosting.com.
My sites in this account,
myhosting.com , files in httpdocs folder
second.com , files in second.com folder
controller.com , files in controller.com folder
Normal running process:
A page on second.com sends an HTTP-POST request to a page on controller.com,
for to get a string.
Before controller.com responds to the POST request, sends an HTTP-GET request
to an another page on second.com, for to get the control string.
The page on controller.com, because the string it receives with GET is correct
it responds positively to the POST request in the first step.
Incorrect operation (performing normal operation from myhosting.com):
A page on myhosting.com sends an HTTP-POST request to a page on controller.com,
for to get a string.
Before controller.com responds to the POST request, sends an HTTP-GET request
to an another page on myhosting.com, for to get the control string.
According to the log records, myhosting.com responded to the GET request
although, the page on controller.com has not yet evaluated the GET's response,
it answers the POST request in the first step with the HTTP 500 error. The error
cannot catch with try/catch.
Where does the error come from? Access permissions? Verb settings? It was working
initially. I deleted the index.aspx from the default doc list in the myhosting.com
and unwittingly did another action, then the error started to occur.
Thanks in advance for the answers.
Solved with Failed Request Tracing. The reply to the post message contains no error details. With this method, error details can be obtained.

How To Read Request Payload With Content Type Is application/octet-stream In Python?

I'm trying to send request to this website https://game.elemon.io/02.17/ to simulate login action, I found request login but the Request Payload seems to be application/octet-stream content type, I can't read it so I don't know which key and value I should use to implement this login action (I have session). Please help me (please look at picture below for more detail)
P/s : this is a gamefi web, so I manually login by metamask wallet

Can't authorize into Http request

Sorry for my English)
I have an account on https://naurok.com.ua (login: kuz.code.official#gmail.com, password: 2455s1). I log in, then follow the link /test/test-po-filosofii-541029/flashcard.
After I followed the link, it loads the cards through a request /api/test/documents/541029/flashcard.
I need to send it successfully:
I test request by Postman api/test/documents/541029/flashcard. Request sends with captured Cookies, but it says I need to log in ("Необходимо авторизоваться").
Why query work on website but doesn`t in Postman?
you need add the most important thing which is to add the cookie PHPSESSID you can find it on your browser when inspecting the request on network tab
like this
click on "cookies" on postman
to have it like this
or click on "code" on postman
I noticed also you need referer header otherwise it won't work

Use postman to send data to a apigee proxy

I want to post the following json data to apigee proxy.I created a apigee proxy with no target servers.
I copy the url from overview section in apigee and copied it into url in postman.I changed the verb in postman to Post.
I used the following apigee community post.
https://community.apigee.com/questions/54530/creating-an-api-proxy-for-
post-request.html
The data I post is { "age":30 }
When i click on the url it gives me response 200 .But in trace we can see the post action. I change postman header into Json(application/json)
But how do I check the data in my proxy?Next time I click on the url in overview section in apigee it shows me no data.
Try clicking on the individual steps in the Trace tool. There you can see the request payload that you're seeking.

Can't get authentication token from web api 2

I am new to Web Api 2. I am trying to build a project to explore token authorization. I created a new project in VS 2013 and selected the WebApi2 template and used Fiddler to emulate http requests. I didn't change anything in the template, just ran it as it was and tried to play with it with Fiddler. I successfully created a user by issuing request to /api/account/register but I can't login by issuing a POST request to the /Token endpoint. The request is:
http://localhost:YYYY/token?grant_type=password&password=admin123456&username=admin
(i also tried to pass the parameters as a json object in the request body).
I get back this:
{"error":"unsupported_grant_type"}
From other posts such as ASP.NET WEB API 2 OWIN Authentication unsuported grant_Type I learned that I needed to enable CORS for web api and at the token endpoint, but that hasn't worked for me.
Are you sure that you are sending POST request message and not GET?
If you simply go to the URL with query string (or open connection to this URL from your code) you are sending GET message by default. It's not what WebAPI with "/token" path is listening for.
If you are calling web service from same place, CORS is not needed. The error "unsupported_grant_type" could be in the format of the data you are passing server in post action.
Try sending with Content-Type application/x-www-form-urlencoded

Resources