I use the 2.8.2.Final quarkus version.
My goal is to get the current Microprofile RestClient User-Agent value and to modify it (e.g. add a prefix).
Is it possible and how?
Thanks
Related
Problem: In email address # replaced by %40.
http header manager:
user defined variables:
http request:
and result tree:
I have researched about this, and they say that, if http method is POST, then it should encoded automatically. But It does not encoded automatically. Any advice, how can I resolve this?
Note: Jmeter version : 3.1 and I am trying to test a rest service.
Please try sending data in Body data instead of sending it in parameters.
Change "Implementation" of your HTTP Request sampler to Java
If you need to change it for more than one sampler - it makes sense to define the setting using HTTP Request Defaults.
I found the answer. #PoorvajaDeshmukh's answer suggest me. Like following (correct defination of body data);
I also tried #DmitriT's suggestion, but I did not work. Thanks for advices...
Instead of using -www-form-urlencoded, I want to use application/json. the value of username and password becomes null. I found on the net that .net core by default accepts json. Why is it not working in my case?
The basic project was created using yo aspnet.
I have implemented the code as shown in the blog https://goblincoding.com/2016/07/03/issuing-and-authenticating-jwt-tokens-in-asp-net-core-webapi-part-i/#comment-1446
I found the answer. Actually I was using [FromForm] attribute for action method parameters. I replaced it with [FromBody]. It is working.
On IE when i try to browse the rest apis, i am getting a application/json response instead of api (text/html) response (Returns html response on firefox). I am using django restframework 2.2.5 for this purpose.
I read through the documnets and understood that in order to overcome the problem of broken headers for IE we need to use TemplateHTMLRenderer explicitly in the view, so i have added the following to the class definition of my view but still i am getting a json response. Am i not doing it correctly or i am missing something else?
class CustomReports(generics.GenericAPIView):
`renderer_classes = (renderers.TemplateHTMLRenderer)`
Can you please help in fix the problem so that i get html response in case of IE as well?
Which version of IE are you using? I believe newer versions of IE should send correct Accept headers.
I probably wouldn't bother trying to fix things up to work around IE's broken behavior, but instead just make sure that you're including format suffixes in your urls. Then you can simply use the .api suffix to see the browseable API, or the .json suffix to see the plain json.
Eg instead of http://127.0.0.1:8000/api-root/, use http://127.0.0.1:8000/api-root/.api.
I am using Selenium 2.8 with TestNG. I need to test usecases where I have to set custom referer header? I tried using addCustomHeader, but didnt work. I also tried selenium.start("addCustomHeaders=true") and then selenium.addCustomHeader("Referer", url) in my test. That didnt work either. Should I be using selenium as proxy. If so how to configure using Firefox and selenium java and how does it work. How to set the referer in that case? Does FirefoxDriver ease the job?
You can try using the BrowserMob proxy for this. Probably you can find more info about support in Webdriver at
https://sqa.stackexchange.com/questions/1276/is-there-a-capturenetworktraffic-implementation-in-selenium-2-via-webdriver
Check out the BrowserMob HTTP Request Manipulation section at
https://github.com/lightbody/browsermob-proxy
I'm attempting to set some session variables depending on which hostHeader was used to access my site. Do I have to parse it out of the URI property or is there a better way? (MVC3/IIS7)
Check out the HttpWebRequest.Host property, which should be equivalent to accessing Request.Headers["Host"] in MVC.
It mentions it's used to "Get or set the Host header value to use in an HTTP request independent from the request URI." If you're not setting this somehow then "then the Host header value to use in an HTTP request is based on the request URI." So inspecting it via the Request.Url.Host or equivalent property is equally sufficient. I don't know of any other way.